All Questions

Filter by
Sorted by
Tagged with
32
votes
3answers
19k views

Programmatically Creating Shipments

I came across different ways to create shipment programmatically. They are //Type 1 $converter=Mage::getModel('sales/convert_order'); $shipment=$converter->toShipment($order); ...
32
votes
3answers
9k views

Magento 2: Plugin before/around/after Interaction

In Magento 2, when you create an "around" plugin public function aroundRenderResult( \Magento\Framework\Controller\ResultInterface $subject, \Closure $proceed, ResponseHttp $response ) { ...
32
votes
6answers
32k views

Magento 2: What is difference between Cache Clean & Cache Flush?

In Magento 2 we have 2 commands php bin/magento cache:flush php bin/magento cache:clean What's the exact difference between them? I'm generally using cache:flush. I never used cache:clean. So, ...
32
votes
4answers
19k views

Modify tax rate on cart quote items and recalculate

I have a category of products which (legally) need to have their tax rate changed when you are ordering more than a certain quantity. I have extended the various tax models to get this working when ...
32
votes
2answers
4k views

Magento 2 - Why is Magento\Checkout\Model\Cart deprecated?

Since Magento 2.1, Cart has a @deprecated tag. Nevertheless, it is still used by Magento itself to store products when shopping. Is the deprecation intended, and if so, and what should we use instead?
32
votes
2answers
3k views

How does Magento2 generate the specific ExtensionFactory and ExtensionAttributeInterface?

I would like to wrap my head around using extension attributes, for example for quote items. It is no problem adding a custom attribute to such an entity using a setup class like in Magento 1, this ...
31
votes
4answers
63k views

Magento 2 - There are no commands defined in the “setup” namespace on windows [duplicate]

I have a problem when I run this command: php bin/magento setup:upgrade Display error: [InvalidArgumentException] There are no commands defined in the "setup" namespace. I found some ...
31
votes
7answers
70k views

How to get stock quantity of each product in Magento 2

How to get stock quantity of each product in list.phtml in Magento 2 ?
31
votes
5answers
73k views

Why Can't I Load a Product by SKU using loadBySku()?

Synopsis I wanted to load a product by SKU there are many articles, blog posts, stack overflow results etc. All I want to know is - why does it have to be so difficult to load a product by a SKU? // ...
31
votes
4answers
52k views

Magento 2 - Remove and change footer links

I want to remove the default links of the luma layout and add new links. How can I do that?
31
votes
2answers
68k views

How to use jquery library in Magento 2?

I am creating a Magento theme where I need to include jQuery. When I add this <link src="js/jquery-1.7.1.js"/> in head. It is working but Magento javascript functions are not working. How to ...
31
votes
3answers
39k views

Bundle vs. Group product

What are the differences between grouped products and bundle products? What is a typical case for using each type?
31
votes
10answers
59k views

How to delete and regenerate URL rewrites in Magento 2?

I have recently created 2 additional store view on magento 2 store. Now the url of category and Products are not for those stores is not proper Eg: http://example.com/catalog/category/view/s/pouches/...
31
votes
8answers
20k views

Is Magento the right platform for 1M products?

I need to see how Magento will perform with 1M SKUs; but I'm struggling to find a large data set of sample data to download - or find a feasible method of generating the feed for import (and the ...
31
votes
1answer
12k views

Conflicts in where clause with ambiguous column names

A bit of context for this. I want to extend the sales order export function (via the grid) to have more columns. I have created a module which adds a new grid for exporting and also a new collection ...
31
votes
8answers
23k views

Magento 2 - How to add captcha to a custom form

I'm developing a custom module which contains a form submission. I would like to add a captcha to it. And we want to use the Magento default captcha library so that the captcha is consistent with the ...
30
votes
4answers
43k views

Magento2 -How to get data from system configuration [duplicate]

Fields added through the system.xml and default values populated with config.xml, how do we fetch the data in Magento2
30
votes
1answer
18k views

Which MySQL Server provides a better performance for Magento

What do you use as a MySQL Server for Magento? MySQL (Oracle) Percona others (MariaDB) Percona provides a set of improvments for InnoDB storage used by Magento intensively, but these improvements do ...
30
votes
5answers
7k views

Learning Magento Plugin Development

I have been a PHP developer for 13+ years, have extensive knowledge of PHP itself as long as some other popular projects like WordPress. I have no experience with Magento. I now have a full time job ...
30
votes
2answers
27k views

Magento CSS and JavaScript not loading due to using file system path

I was unable to install a module using Magento Connect, getting a Connection Error try again later error. Following the instructions of the module developer I attempted to fix permissions in the ...
30
votes
2answers
4k views

Why are so many PHP functions disallowed in the Magento ECG Coding Standard?

The Magento ECG Coding Standard seems to be (at least kind of) official as standard for Magento 1 extensions: https://github.com/magento-ecg/coding-standard But I don't understand the reasoning ...
30
votes
2answers
7k views

Theming - starting from scratch

What is the preferred method of beginning a full site build, from scratch? My builds typically begin from fully mocked-up HTML5 wireframe pages, and we plug in functionality from there. But, part of ...
30
votes
3answers
25k views

where does is_salable come from?

Note: If you've been editing products by PHP code, then re-index them in the admin after, save your self hours trying to work out why they not showing like me below ... I am going round in circles ...
29
votes
3answers
32k views

How to implement translations in design template package CSV's? How does echo $this->__('Text') work?

I have a design package setup like so: design/frontend/package_name/theme_name/locale/ under which I have de_DE, en_GB etc, under which I have corresponding translate.csv files with the various ...
29
votes
6answers
21k views

Adding columns to customer grid using observer or overriding the customer grid

I am facing an issue of adding a column on customer grid and showing values in that column. Here is the observer code that I have been trying to show the column:- if ($block->getType() == '...
29
votes
2answers
22k views

Magento 2: available field types in system.xml

What are available values for field types in etc/system.xml configuration file: <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
29
votes
5answers
26k views

Recommended method to protect /downloader?

Since Magento uses the /downloader as a way to conveniently install programs via Magento Connect Manager it is apparent that this is also a security concern since it allows the possibility for bots or ...
29
votes
4answers
19k views

Theming for Magento 2 - Starting from scratch

Some of you probably read that topic regarding theming from scratch for Magento 1: Theming - starting from scratch I was wondering, what would be the best practice to develop a theme from scratch for ...
29
votes
9answers
17k views

Future Support of Magento 1.9 - Coming Magento 2.0

We want to upgrade our current Magento 1.4.0.1 installation to 1.9.1.0 till autumn this year. The only thing we are unsure about is the future support of 1.9.1.0 since Magento 2.0 will be released end ...
29
votes
1answer
28k views

About Collection Model and Resource Model

I am bit confused about using resource model and collection model. Sometimes when I see examples for loading products using specific attributes, in some examples, they use collection model and ...
29
votes
6answers
37k views

Static Content is not loading after upgrade

After upgrade from the Magento 2.1.0 to the Magento 2.1.3 (using composer) static content is not loading anymore. In the browser console I can see that all files is unavailable (404): I don't see ...
29
votes
1answer
13k views

Magento ER diagram of 1.9.x

I am looking for ER diagram of magento 1.9.x so that i can understand magento database flow and table-relationships. if anyone can provide me COMPLETE ER diagram that will really help me. Like i saw a ...
29
votes
1answer
34k views

Add new field in magento(1.9) customer registration

I like to add new field in customer registration and admin customer creation form. The field name is license number. I searched so many links related to my requirement but those do not work in ...
29
votes
6answers
7k views

Magento 2 - Uninstallable set of packages when deploying magento-sample-data

I've followed this Magento DevDocs tutorial to install sample data after installing Magento 2. But after executing the last command ./bin/magento sampledata:deploy I get the following error: ./...
29
votes
9answers
46k views

How to change the Admin session time in Magento?

It is possible that sometimes the time that the admin session is active is too short. How to change the time it takes to auto-logoff the user from the back-end?
29
votes
5answers
25k views

How to reveal Magento version by code?

I want to know whether there is any class file available for to know the magento version. If the site has been hacked how to to reveal the version? I know there's a way as follows. Mage::getVersion()...
29
votes
2answers
2k views

Why c is lowercase in controllers of Magento?

Why is c lowercase in controllers folder name? Whereas Model, Block and Helper are starting with an uppercase letter?
29
votes
4answers
2k views

New patch supee-6788 how to apply patch

After weeks of waiting for the patch today (27.10.2015) it was released: SUPEE-6788 A lot of things were patched and also is encouraged to review installed modules for possible vulnerabilities. I ...
29
votes
3answers
5k views

Creating Integration Tests for Magento 2 Modules

So far for my Magento 2 testing needs, I've been using PHP Unit as (more or less) an acceptance tester -- testing results of server and HTML requests made into a system with my module(s) installed. I'...
29
votes
2answers
4k views

Magento 2 Templates: Use `$block` or `$this`?

In Magento 2, the $this variable no longer refereces to a template's block object. It refers to a template class Magento\Framework\View\TemplateEngine\Php However, this template class has a ...
29
votes
5answers
23k views

Different storeviews or websites in subfolders

A client wants his multistore shop to be set up like this: http://www.domain1.org/de/ -> website 1, store view 1 http://www.domain1.org/en/ -> website 1, store view 2 http://www.domain1.ch/de/ -> ...
29
votes
2answers
1k views

Magento Profiling - Why so many EAV: Magento\Eav\Model\Config::getAttribute?

I'm just reviewing the speed of a store and just wondering if anyone knows more about why I have over 100 EAV: Magento\Eav\Model\Config::getAttribute 0.006978 rows within my profiler. It's just I do ...
28
votes
3answers
29k views

How to disable Two factor Authentication module in Magento 2.4 [closed]

Anyone, please help me with how to disable the Two-factor Authentication module using a command-line. Thanks.
28
votes
5answers
42k views

How to convert number into currency format in magento2

I want to convert number into currency format in magento2 like we do in Magento 1.x with this $_coreHelper = $this->helper('core'); $_coreHelper->currency(number_format(50,2),true,false) How ...
28
votes
1answer
135k views

Magento2: How to load product by id [duplicate]

I got the product collection in my custom template using the following snippet: <?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); /** @var \Magento\Catalog\Model\...
28
votes
7answers
52k views

Magento 2 Get Current Store Date Time

In Magento 1.x you could get the store date time via Mage::getModel('core/date')->gmtDate(); What would be the equivalent to this in Magento 2.x?
28
votes
5answers
32k views

Magento 2 remove “Estimate shipping costs and tax” from cart

I want to get rid of the "Estimate Shipping costs and Tax" block in the cart. The devdocs tell Disabling a component is the way to go, so I tried the following: <body> <referenceBlock ...
28
votes
18answers
48k views

Magento 2 admin this webpage has a redirect loop

Magento 2 just released last night and I can't wait to work on it. I tried installing it with all prerequisites. Frontend works fine but when I tried to open backend it says "this webpage has a ...
28
votes
8answers
18k views

You need to configure Two-Factor Authorization in order to proceed

Having just installed 2.4.0 from scratch, I ran into an "issue" when logging into Magento Backend for the first time: Failed to send the message. Please contact the administrator You need ...
28
votes
20answers
11k views

Security Patch SUPEE-11155 - Possible issues?

Magento has released a new security patch for M1, and updates for M1 and M2. What common issues do you have to watch out for when applying this patch/upgrade? Magento 1 https://magento.com/security/...

15 30 50 per page