We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [magento2]

General questions about Magento 2, not specific to a minor version. Use this tag to distinguish from Magento 1. If you have issues with a specific version, please use the appropriate 'Magento-2.x' tag instead. Functionalities between Magento 2 minor versions might differ.

Filter by
Sorted by
Tagged with
21
votes
1answer
8k views

How to install a specific Magento 2 version with Composer?

I want to install Magento version 2.1.7 with the Composer, I found in the docs that I can use in the require: "magento/product-community-edition": "2.1.7", but composer says that requested package ...
21
votes
3answers
12k views

Magento 2 - How to get the extension's configuration values in the phtml files?

I'm working with Magento 2 - beta. But cannot find how to get the configuration values in the phtml files. eg: I want to get my custom modules configuration values in Magento_Catalog/templates/...
21
votes
4answers
17k views

Why aren't Magento developers using Zend Framework 2 for Magento 2?

Magento will continue to mostly use the original Zend Framework (version 1) for Magento 2 (source: Magento 2 and Zend Framework 2 ) Seeing as how Magento 2 will not be backwards compatible with ...
21
votes
5answers
29k views

Magento 2 How to add custom sort by option

I need to add an additional filter based on created_at attribute for sorting product list by latest product. I tried to figure it using below file app/design/frontend/Vendor/ThemeName/Magento_Catalog/...
21
votes
2answers
5k views

Magento 2: what is the $data array constructor parameter?

So I noticed that in most models and blocks, there's this array $data = [] given as the last parameter of the constructor. For example \Magento\Catalog\Block\Product\ListProduct public function ...
21
votes
3answers
3k views

Request flow of Magento 2

Their is a lot of fuss going about Magento 2, concept like Namespaces etc has been incorporated into it. I am just curious to know how REQUEST flow has been handled in Magento 2, can somebody give me ...
21
votes
3answers
9k views

Difference between _module.less and _extend.less

Is there any difference between extending a theme using _module.less and _extend.less? And what is the best practice when extending a module/theme? My first thought was it's better to use _module....
21
votes
2answers
2k views

Magento 2: What's a “static view file”

If I use the module:enable or module:disable command to enable or disable a module, php bin/magento module:enable Pulsestorm_TutorialObjectManager1 php bin/magento module:enable ...
21
votes
2answers
713 views

Magento 2 - good practice to use/avoid magic getters?

Magic getters on Varien_Object (M1) and DataObject (M2) are common practice, but with Magento 2 it feels wrong to use it. Good: easy to read/write Bad It causes problems when using digits in keys (...
21
votes
2answers
889 views

Magento Developer Certification for Magento 1 or 2

I am a Magento 1.x developer and preparing for Magento certification. I may appear in exam for certification in next 5 to 6 months. If Magento 2.x is released before my exam then will i have to ...
21
votes
1answer
5k views

Block with Cachable=false not rendered on product view page

I am using magento2-1.0.0-beta4 I have copied the checkout.root block from app/code/Magento/Checkout/view/frontend/layout/checkout_index_index.xml to the product page. Everything is working fine, ...
21
votes
2answers
5k views

Magento 2 checkout - add a custom field between shipping address and shipping method

I'm trying to add a custom field in between the shipping address and shipping method sections. And I want values of this field to be stored in both quote and sales_order tables ultimately. This is ...
21
votes
0answers
829 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 ...
21
votes
1answer
9k views

Magento 2: Uncaught TypeError: Cannot read property '*' of undefined in (section-config.js:33)

It's duplicate question but I am facing the same issue while adding the product & removing items from the cart page. I have spent almost a day to resolve but no luck hope someone could help me ...
20
votes
4answers
13k views

How to override a HTML file using a custom module?

I'm developing a custom module for payment method in Magento 2. Currently, I'm using cc-form.html from vendor directory and module working fine. See below path: vendor/magento/module-payment/view/...
20
votes
3answers
17k views

Magento 2 custom grid column sort order

I made a custom grid in Magento admin using the UI Component. Basically, all is working fine, besides the order of the columns that is not showing right. as you can see the action column is right at ...
20
votes
5answers
35k views

how to create a form popup-modal in magento2

I am new to magento2. i'm trying to create a popup-modal for my new form. I have created a popup which works fine but unable to create a modal. Following is the code for popup which loads on page ...
20
votes
2answers
11k views

What are all the allowed `xsi:type` values in the xml's from Magento2

In Magento 2 (almost) all arguments listed in xml files have an attribute xsi:type that determine how the value of the argument is iterpreted. For example, in di.xml file of the backend module there ...
20
votes
2answers
12k views

Magento 2: Implement UI Fileuploader

I recently implemented the FileUploader Ui Component in my form on Magento 2.1.7. The code for it is here (app/code/Vendor/Blog/view/adminhtml/ui_component/vendor_blog_form.xml): <field name="...
20
votes
2answers
3k views

What is IdentityInterface in Magento2

I see that a lot of the models in Magento 2 implement Magento\Framework\DataObject\IdentityInterface. This interface has a single method called getIdentities The implementations of the method usually ...
20
votes
4answers
2k views

Magento 2: What's a Service Contract

In Magento 2, is there a concrete example of something that's built using the Service Contract concept? I've seen this term thrown around a lot, but looking at Magento 2 as it exists now it's not ...
20
votes
3answers
3k views

Magento 2: How Should Module Developers Read their Own Configuration Files

Scenario: I am a Magento 2 module developer. I want to create a configuration file in app/etc. I want this file to be "scoped" by area app/etc/my_file.xml app/etc/frontend/my_file.xml app/etc/...
19
votes
6answers
42k views

Magento 2: Call a static block using xml

How i include a static block in a page using xml. For example i created a static block with identifier promo. In magento 1 we include a static block using below code <block type="cms/block" ...
19
votes
9answers
45k views

Magento 2: Get product attribute’s select option id,label for configurable product

How to get an option value based on the option id in Magento, or get an option id based on the option code ? Example: how to get the color attribute option id 10 from the label "Red", and get the ...
19
votes
22answers
45k views

Magento 2 Error ERR_TOO_MANY_REDIRECTS

I'm new to Magento, after installation of Magento 2 community edition.I am not able to access the admin panel. I am getting below error. This web page has a redirect loop Error ...
19
votes
5answers
28k views

Magento 2 How to Add a New Column to Orders Grid

I've added a new column to the table sales_order called export_status, now I want to add new order grid column with the data from the new sales_order column. I've managed to add column to the ...
19
votes
12answers
35k views

There are no commands defined in the “cache” namespace

Update Everything is working now but There are no commands defined in the "cache" namespace is still there. I tried chmod 777 -R var/generation, didn't fix a thing. AFAIK no module is enabled ...
19
votes
5answers
15k views

Get product attribute in cart in Magento2

I'm trying to grab a product attribute in the cart template. But I just does not work! The attribute is set to Visible on Catalog Pages on Storefront = yes and Used in Product Listing = yes I use a ...
19
votes
3answers
13k views

Magento 2: How/Where is the `getTemplate` Knockout Function Bound?

Many Magento backend pages contain the following in their source code <!-- ko template: getTemplate() --><!-- /ko --> I understand (or think I do?) that <!-- ko template is a ...
19
votes
2answers
21k views

Magento 2.1.1 How to load Order with Increment ID using OrderRepository object

What would be the latest best practice to load Order using increment ID (instead of Order ID) using OrderRepository
19
votes
6answers
5k views

Magento 2: When should I run which commands?

I have been working with Magento 2 for 2 months now. I realized that I am using bin/magento setup:upgrade way too much. I think I do not know when I have to run that command. Here are the situations ...
19
votes
14answers
32k views

Missing write permissions in directory pub/static when run bin/magento setup:upgrade

The day before, I updated a new module and it was working normally. Now, when I run bin/magento setup:upgrade, I receive the below Exception. I tried setting permissions to 777 (or 770) for the pub ...
19
votes
2answers
23k views

Magento2 Notification messages

In Magento2, how do we print the input data into notification messages for - Error - Success - Warning - Notice
19
votes
2answers
10k views

What are the allowed condition types in Magento 2?

What is the list of allowed condition types while adding filter to search criteria in Magento 2? All of the examples about search criteria in the internet use eq condition type. Is there any other? ...
19
votes
7answers
16k views

Strange Error when running setup:upgrade after module installation

I have tried to install wyomind google shopping and have the following error when running bin/magento setup:upgrade. [UnexpectedValueException] Unable to retrieve deployment version of static files ...
19
votes
2answers
34k views

How to Create Custom Form in Magento2 Frontend?

I want to create a custom form in frontend and using this form customer can get an appointment. In my form, I have 4 Fields. First Name (text filed) Last Name (text filed) Phone No. (numeric field) ...
19
votes
6answers
20k 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, ...
19
votes
3answers
21k views

Fatal error: Cannot instantiate interface in Magento 2?

As the part of creating bundle product programmatically in Magento 2. I am getting below error. Even i removed var/cache and generation. This may be a duplicate question but none of the answer is ...
19
votes
2answers
6k views

What is __construct and _construct in magento2?

In Magento 2, most of classes have these two constructs (__construct and _construct) methods. What is the difference between them?
19
votes
4answers
22k views

Regenerate catalog cache images issues

I'm doing migration process from Magento 1.9.2.4 to Magento 2.1.6, after migration completed, I move media folder of M1 to pub/media M2. Now the problem is some of the images doesn't generate in ...
19
votes
4answers
21k views

How to remove SID (session ID) from URL in Magento 2

How to remove the session ID from the URL in Magento 2 (frontend). This is the SID query parameter in the URL. For example: https://example.com/contact/?SID=sfl317buq8ru4uf4a...
19
votes
2answers
2k views

List of not-used core modules that can be turn off with no harm

Reffering to this this topic for Magento 1, maybe it would be useful to prepare a list of core Magento 2 modules that can be turn off or completely removed with no harm for our store, because they are ...
19
votes
2answers
6k views

Usage of page factory class in magento2

What is the purpose of rendering the custom module page in Magento2 using the result factory \Magento\Framework\View\Result\PageFactory class injected in the constructor and making the page to display ...
19
votes
2answers
884 views

Magento 2 DI best practices

Let's say I'm building a Magento 2 extension that does....well...not important. Let's say it does super awesome stuff. But I want to make sure that this is build using the proper standards so other ...
19
votes
2answers
17k views

How to add a customer custom-attribute in the customer address edit form?

I added a customer custom attribute as customer_address type and it runs correctly in the admin and in onepagecheckout as well as in shipping & billing address. I created: my_namespace/my_module/...
19
votes
2answers
4k views

How to implement multiple category filter in Magento 2 layered navigation

I am implementing multiple category filters for layered navigation. I am getting the result as per my requirement but the collection size is coming wrong remains same as the parent categories ...
18
votes
6answers
9k views

Magento 2 : list of command shortcuts

I need to know the list of useful commands for Magento 2 in short-cut form Can anyone help me?
18
votes
3answers
20k 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 ...
18
votes
6answers
15k views

add to cart not working localhost Only in chrome (Magento 2 fresh install )

I've installed magento 2 fresh on localhost, and trying to add items to cart but didn't work.. when click on add to cart button, button will change into adding and stays there, didn't add to cart ...
18
votes
6answers
8k views

Magento 2 - How to retrieve product informations

I want to use functions like getName(), getPrice(), etc. of product to retrieve product information in Magento 2. Can anyone show me how can I achieve that ?