Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

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
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 ?
18
votes
1answer
9k views

How Does Magento 2 Apply KnockoutJS Bindings

Per a very cursory reading of the KnockoutJS documentation, initializing a very basic Knockout view looks like the following // This is a simple *viewmodel* - JavaScript that defines the data and ...
18
votes
5answers
12k views

How can I change favicon. icon in magento 2

How can I change favicon.icon in magento 2 from backend? I check it in Stores -> Configuration -> General -> Design no option there?
18
votes
2answers
17k views

Magento 2: Product URL Suffix

How do I remove the .html suffix from the product pages?
18
votes
5answers
13k views

Add new tab in product edit page in admin Magento 2

I'm trying to create a custom module that will add a new tab on product edit page, right under Basic Settings. Can someone provide an answer?
18
votes
2answers
10k views

Magento 2 - How to add the DateTime UI Component

I want to add new field as datetime in CMS page section while adding new page, I found that magento using UI Component for it, so after digging I could able to add the date field by using below code ...
18
votes
2answers
16k views

How to create a Child Theme in Magento 2

I want to modify certain aspects of the out-of-the-box Luma theme but I would like to do it by preserving the original file(s) and also ensuring that whenever I update Magento I preserve my changes as ...
18
votes
4answers
19k views

Magento 2: requirejs-config.js in themes?

Is it possible to include a requirejs-config.js file (or otherwise configure RequireJS) via a Magento theme? Or is the capability reserved for Magento modules? The dev docs information on theme ...
18
votes
2answers
29k views

How to enable error and exception logging in Magento2?

I am unable to see any type of error in magento2. i am implementing custom payment gateway but when i add a dropdown list in backend admin panel of magento2 At that time its shows blank page and when ...
18
votes
2answers
4k views

What's a hard dependency and what's a soft dependency?

In Magento 2 (any stable version) you can run this command bin/magento info:dependencies:show-modules and you will get a csv file in the root of your application called modules-dependencies.csv with ...
18
votes
4answers
10k views

How to increase the quality of product photos JPG (Magento 2)

The JPG compression on Magento 2 is very strong, so that the quality of product images get really bad in Catalog and Product view. How can I change the Image compression for JPG's in Magento 2?
18
votes
3answers
2k views

Difference Between “page” and “layout” Root Tags in Magento 2

In Magento 2, some layout handle XML files open with the <page.../> root tag. Others open with the <layout.../> root tag. Does using either of the above tags introduce any ...
18
votes
8answers
7k views

Magento 2: “Your web server is set up incorrectly and allows unauthorized access to sensitive files. Please contact your hosting provider”

My Magento 2 development environment has started poking me with the following error message Your web server is set up incorrectly and allows unauthorized access to sensitive files. Please contact ...
18
votes
2answers
4k views

Magento 2: How to Check if a Module's Installed

In Magento 2, is it possible to check if a module's installed at runtime? In Magento 1 I'd either use the isModuleEnabled helper method, or manually fetch the global configuration tree and check the ...
18
votes
2answers
4k views

Magento 2: best practice to add/delete product Images programmatically?

I want to upload images to the existing products. The images are in import_dir. And they need to be added to the product that already exists in the catalog. I could find only 2 ways how to do it. 1. "...
18
votes
3answers
3k views

Property does not have corresponding setter in class Magento\Quote\Api\Data\AddressInterface while change checkout step

1 - I add a eav attribute to customer_address $attributesInfo = [ 'reference' => [ 'label' => 'Reference', 'type' => 'varchar', 'input' => 'text', ...
18
votes
5answers
2k views

Magento 2, new widget with image chooser parameter, does not save picture

I create a new widget and one of the parameters is a picture chooser, I just use this code. Everything looks well. I can open media folder and choose the picture I want to use. When I choose the ...
17
votes
6answers
23k views

How to add/remove links on my account navigation magento2?

How to remove "Billing Agreements" and "My Wishlist" links from the navigation menu on customer account page?
17
votes
6answers
38k views

Magento 2 - How to get attribute options value of eav entity?

How can I get the attribute options values of eav entity? I found solution only for magento 1.x but M2 I don't know. M1: $attr = Mage::getResourceModel('eav/entity_attribute_collection')->...
17
votes
2answers
27k views

Magento 2: Diagram of database tables, such as Orders, Products, etc. and their relationships

I'm looking for a diagram or schema of all Magento 2 database tables, such as Orders, Products, etc. and their relationships with each other.
17
votes
7answers
82k views

Magento 2 did not sign in correctly or your account is temporarily disabled

When trying to login to admin account in my local test setup it says : Account is temporarily disabled even i used correct user and password.
17
votes
3answers
29k views

Get Current URL from a PHTML - Magento 2

I'm struggling trying to show the current URL from a PHTML in Magento 2. Any suggestion?
17
votes
4answers
15k views

Magento2.1.0 showing error Required parameter 'theme_dir' was not passed while saving product in admin

I am facing this error Required parameter 'theme_dir' was not passed when i try to save the product in admin. I checked the theme configuration it was assigned to the stores. Recently i have upgraded ...
17
votes
5answers
23k views

No images or JS on new Magento 2 installation

I've just installed Magento 2 onto my production server under a development. subdomain. The install appeared to have been successful but I've noticed there are no images or working javascript in both ...
17
votes
6answers
28k views

Magento2 not reading my requirejs-config.js

Hi I'm new to Magento2 and trying to figure out how RequireJS works in Magento. Here is my situation: I have following module: app/code/Mymodule/Test/view/frontend/requirejs-config.js Here is the ...
17
votes
2answers
14k views

How to add css class on body [Magento2]

I am trying to add a css class on body tag but not able to find any file, from where the body tag is rendered. I need to add one css class on body tag such as others are coming > page-with-filter ...
17
votes
6answers
13k views

Magento 2 Custom Admin Action Redirected to Dashboard

I am taking the Magento 2 fundamentals development course and the Admin Router / Controller exercise seems out of date. The router does work, but the controller does not, it always just re-routes to ...
17
votes
8answers
25k views

How to change magento2 admin url?

Once the installation is completed, is there a posibility to change admin url? If yes how can I do that?
17
votes
6answers
10k views

How to get store phone number in magento 2

I want to display phone number saved in magento admin in frontend in magento 2. Like in magento 1.9 its like $storePhone = Mage::getStoreConfig('general/store_information/phone');
17
votes
2answers
20k views

Magento 2: How to create a customer custom attribute?

What are steps to create a custom attribute for Customer entity in Magento 2?
17
votes
3answers
7k views

Magento 2 add custom product attribute validation from install script

[ 'type' => 'int', 'backend' => '', 'frontend' => '', 'label' => 'XXXX', 'input' => 'text', 'frontend_class' => 'validate-greater-than-zero', 'source' => '', 'global' =>...
17
votes
2answers
2k views

Rewriting Magento 2 classes vs Plugins

Magento 2 has the concept of Plugins/Interception/Interceptors opposed to Magento 1. These act like a before|after the event for every public method. Which is nice. You can also use the around plugin ...
17
votes
4answers
14k views

Why `code` folder is missing under `app` folder in magento 2 stable version?

I have downloaded Magento 2 stable from https://www.magentocommerce.com/download with sample data and installed. It's working fine in both areas i.e. frontend & backend. But I could not find app/...
17
votes
3answers
1k views

What Classes are “Intercept-able/Plugin-able” in Magento 2

Date: May 30, 2015 (given the changing nature of Magento 2). Magento 2 introduced a plugin concept, implemented via an interceptor pattern. What's not clear from the docs is -- which classes and ...
17
votes
3answers
4k views

Magento 2: Are Flat Tables Still a Thing?

Are flat tables still a thing we need to worry about in Magento 2? I know there's UI where we can turn the flat tables on, but I'm unsure how well they've been tested, and if they're even needed ...
17
votes
3answers
13k views

Magento 2: rewrite controller

how can i rewrite a controller (that's actually an action) in Magento 2? I tried, as instructed here like this: I have my own module called Namespace_Module with a di.xml file, that is taken into ...
17
votes
1answer
16k views

how to add pagination on custom collection in Magento 2

I am working on custom module. How can i use default magento pagination with my custom collection and also set custom limits on that?
17
votes
2answers
3k views

What does the “exclude” Tag in Magento 2's view.xml file do

The Magento 2 "blank" theme includes the following tag hierarchy. <exclude> <item type="file">Lib::jquery/jquery-ui-1.9.2.js</item> <item type="file">Lib::jquery/...
17
votes
6answers
9k views

How to make Magento 2 development sites fast?

I turned off all caches and I set deployment mode to development. So my Magento 2 development sites on all machines are very slow compared to Magento 1.x sites. Is it normal for Magento 2? What ...
17
votes
2answers
5k views

What is the purpose of the LESS lib-css mixin?

The .lib-css() mixin is used heavily in Magento 2 LESS files. However its purpose is not apparent, and the mixin definitions don't provide any helpful documentation: // // Add any css property // --...
17
votes
1answer
2k views

Best plan about delta migration

Three months before I migrated Magento 1.9.3.3CE to Magento 2.1.7EE I added/update CMS content. Install 20+ extensions and configured all. For testing, I altered some of the products, orders, ...
17
votes
1answer
4k views

Magento 2 Enterprise: Create New Module in vendor directory

I tried to create new module in vendor directory in Magento Enterprise 2.0.0. The module could not be loaded after I ran the Magento setup:upgrade. If I move my files to the app/code directory, the ...
17
votes
2answers
5k views

how to reorder (switch) billing address before shipping address

on the onepage checkout I need to reorder the billing address before the shipping address. in fact the logic should be the other way around than it is now. if the shipping address differs from the ...
16
votes
5answers
23k views

Magento 2: How to reset Customer Password from Database

It's hash for customer password in DB. So MD5 & Sha1 is not working. UPDATE `customer_entity` SET `password` = MD5('test123') WHERE `email` = 'X@X.com'; So how to update password using database ...
16
votes
5answers
24k views

How to call helper method in .phtml file

Trying to develop something in magento 2. But, I didn't find how to call a Helper method in template(.phtml) file. I want a replacement of below code: $this->helper('modulename/helpername')->...
16
votes
4answers
25k views

How to get root directory path in a phtml magento 2?

$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $storeManager = $objectManager->get('\Magento\Store\Model\StoreManagerInterface'); $mediaPath = $fileSystem->...
16
votes
3answers
13k views

How to log all Magento 2 SQL queries? [duplicate]

Want to get all Sql queries during the page load. can any one help me on How to log all Magento 2 SQL queries ?
16
votes
2answers
10k views

How to create varien object in magento 2?

In magento 1 we can create varien object like this $collection = new Varien_Data_Collection(); $varienObject = new Varien_Object(); $varienObject->setData($data); $varienObject->setItem($item);...
16
votes
3answers
26k views

How to turn Magento 2 Maintenance Mode ON or OFF?

I am not able to set Maintenance Mode in 2.0 version. Can someone tell me the steps that how to manage maintenance mode with magento 2.0?
16
votes
4answers
7k views

Magento 2 log database queries

In magento 1.x I use the n98-magerun tool to get a log file for all DB Queries: n98-magerun.phar dev:log:db [--on] [--off] Is it possible to log database queries in Magento2?