Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [magento-2.1]

Denotes questions related to Magento CE and EE 2.1.x

46
votes
2answers
21k views

Magento 2 - How to add a custom field to checkout and then send it

All tutorials are covering only adding a fields, but saving value of this fileds is skipped #mindblown. I don't know why, it's most important part of adding any field or form. I tried to follow ...
31
votes
1answer
4k views

Why is Magento 2.1.0 released before 2.0.9?

Magento has released 2.1.0 on June 23 but has released 2.0.8 (July) and 2.0.9 (Aug) after that. (https://github.com/magento/magento2/releases) Why are they releasing lower versions? If anybody knows ...
29
votes
2answers
3k 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?
25
votes
7answers
8k views

Magento 2: Fails to upload a transactional email logo from admin

I'm trying to change transactional email logo from. Admin > Content > Design > Configuration > Edit any record -> Transactional Emails It's on Magento 2.1 but logo showing broken image after ...
24
votes
1answer
4k views

Magento 2.1: using the entity manager

From 2.1 Magento has introduced Magento/Framework/Model/EntityManager I may be wrong here but from my understanding it is to replace Magento/Framework/Model/AbstractModel which was implementing the ...
20
votes
6answers
18k 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 ...
20
votes
12answers
24k views

Refused to apply style “because its MIME type ('text/html') is not a supported stylesheet MIME type”

Suddenly CSS is not loading on my Magento 2 admin panel. The frontend is working fine. Error details: "Refused to apply style from 'https://www.ornativa.com/pub/static/version1502029409/adminhtml/...
19
votes
1answer
4k views

Magento 2: what are the Interceptors file in var/generation?

So I noticed some Interceptor.php files in var/generation I know that this folder contains generated classes created on the fly for the following: Factories Proxies Plugins I assume that ...
17
votes
2answers
4k 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
2answers
27k 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) ...
16
votes
2answers
7k 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="...
16
votes
5answers
1k views

What is the preferred structure of a Magento 2 project under VCS?

When I start a new M2 project, the first thing I would do is to install the core via composer: composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition I ...
16
votes
0answers
6k 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 ...
16
votes
5answers
2k views

Error on product page when you have related products and full page cache is on

I get this error on some products that have related products: Warning: Invalid argument supplied for foreach() in vendor/magento/module-catalog/Block/Product/ProductList/Related.php on line 129 This ...
15
votes
2answers
17k 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
15
votes
7answers
15k views

Add header and footer in checkout page Magento2

By default Magento 2 don't provide HEADER and FOOTER in CHECK OUT page. So I checked checkout_index_index.xml file on path app/design/frontend/package_name/theme_name/Magento_Checkout/layout/...
15
votes
6answers
20k views

Magento 2 Installation Fatal Error - Cannot instantiate interface

I have installed a fresh Magento 2.1 over the command line and always get the same fatal error when trying to access the frontend or backend. Fatal error: Uncaught Error: Cannot instantiate interface ...
15
votes
3answers
7k views

Magento 2 StoreManagerInterface already exists in context object in compilation

I am getting this error in my extension. PackageName\ModuleName\Block\Enhanced Incorrect dependency in class PackageName\ModuleName\Block\Enhanced in /var/www/html/app/code/...
15
votes
4answers
4k views

Magento 2 Add dropdown list to shipping method

I develop shipping method for some logistic company. This company has many offices where customer can get his order. I can get offices list by сity in API but i don't now how better represent this ...
15
votes
3answers
28k views

Base Url Change Magento2.1

I have changed Base url in Magento 2.1, but it does not works. While installing I have set base url to www.domain1.net. I need to change it to www.domain2.net. What I tried: Update baseurl in ...
15
votes
1answer
5k views

The configuration parameter “componentType” is a required for “advanced_pricing_button” component. | Upgrade Magento 2.0.7 => 2.1.0

After a lot of issues I managed to update Magento 2.0.7 => Magento 2.1.0 After checking the upgrade I see 2 issues: 1. The frontend is not displaying any products. 2. When I want to edit the products ...
15
votes
2answers
2k views

Magento 2 Show timepicker using UiComponent not Datepicker

I want to show timepicker in my UiComponent form As Magento Docs show the variations they provide timepicker : I want this using UiComponent in my form. Note : Need to show schedule time so no ...
15
votes
1answer
447 views

Magento2 Catalog Product Options

We found this issue when working in a default Magento2.1. While creating customizable options for a product, if I select the drop-down field a second time, the spinner never stop loading. Please ...
14
votes
5answers
22k 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 ...
14
votes
7answers
18k views

Magento 2.1.1 not compatibile with PHP 7.1.0

I've a new server with PHP v7.1.0RC3 installed. According to DevDocs Magento 2 is compatible with 7.0.2 up to 7.1.0, except for 7.0.5 which makes PHP 7.1.0 compatible with M2 however when tried to ...
14
votes
5answers
5k views

Why Magento 2 uses Knockout instead of Angular or React

My question is as simple as it says in the title. Its why would Magento choose knockout instead of other frameworks like angular or react? Is there a specific reason? Also is this the right ...
14
votes
2answers
9k views

Best Way to Load a Custom Model in Magento 2

Because it was hard for me to find the right way, below you could find the best practice I made mine. Enjoy, correct my English if needed and say me I'm wrong if I am. :) Edit : ... and I found out I ...
14
votes
4answers
9k views

Magento 2 WYSIWYG Media image directive using admin url

Why is magento 2 creating directives for media images using the admin url? for example when i add an image on category page WYSIWYG it adds <img src="{{media url="wysiwyg/image.jpg"}}" alt="" /&...
14
votes
1answer
3k views

Magento 2 : Show product ratings for each star, average ratings and % of 5 star ratings on product page

I want to display ratings on the product page like this: How many users selected 5/4/3/2/1 star ratings The average rating, displayed as stars Percentage of users selected a 5 star rating I need ...
14
votes
2answers
2k views

How to make product grid in frontend in custom module magento 2?

I have created brand page to display details with associated product list. I want to show that product list in grid same as admin. Can it be possible to show grid in frontend same like backend ?
14
votes
1answer
484 views

Magento 2.1 Ui Component form field Token input

I want to add tags in an input field , in a similar fashion as it is done in product form to add catageories - which is show in the image below. This much task I have achieved by adding field ...
13
votes
4answers
2k views

What are all the tools available for checking Magento 2 coding standard?

I am currently working on Magento 2 coding standard checking project. Any other tool available other than PHP_CodeSniffer to check Magento 2 and PHP coding standing.
13
votes
1answer
3k views

Best way to extend module less found in web/css/source/module, like _minicart.less?

Which is then the best way to extend less files content in <module>/web/css/source/module/, like for instance Magento_Checkout/web/css/source/module/_minicart.less? Assuming that to A) ...
13
votes
3answers
2k views

Magento 2: Difference between Models and Data Models

I'm aware that Magento 2 introduced data models as part of the service contract architecture. Data models usually implement interfaces defined in Api/Data/ of a module. But, Magento seems to have ...
13
votes
1answer
1k views

Magento 2 Add Category Tree Renderer Input With Modal Button

I am trying to place the category input for my custom form using uicomponent form. I am able to create dropdown but how I can create the button and open a new modal from it? Can I create a button ...
13
votes
3answers
273 views

Improve performance on SOAP calls

I have a performance problem with Magento 2.1 In my shop, I have 90.000 products. I added these products to soap. When I did this it took round about 7 seconds for each article (product?) (Request>...
12
votes
6answers
39k 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.
12
votes
4answers
18k views

Magento2: Get Media URL In Template File (Without direct Calling Object Manager )

How to Get Media URL in Template file ? All the solution i found is calling Object Manager directly. My another concern, Can you ever call object manager directly as best practice ? (because in most ...
12
votes
4answers
23k views

How to override blocks in v2.1

I'm trying to override the Topmenu block in Magento 2.1 but can't find any guide to do so. Everything I've found on here and elsewhere either seems to apply only to version 2.0 which appears to use a ...
12
votes
1answer
7k views

Where do I find the SYSTEM VALUE defaults? magento 2.1

I want to change the url rewrite area a bit - and I thought I would ask this question that has been bugging me for a bit: Where are the defaults set? For example for url rewrites, I have to uncheck "...
12
votes
2answers
4k views

How to call static block in knockout template file?

I am Using Magento 2.1. Want to show some custom shipping message for shipping method on checkout page, I have done it by editing directly to the knockout template file. Magento_Checkout/web/...
12
votes
1answer
1k views

Magento 2.1 adding new component type problem

I added a new form element type called Company\Module\Data\Form\Element\PdfButton, when it is version EE 2.0.7 and used this element in a custom tab(added by overriding Magento\Catalog\Block\Adminhtml\...
11
votes
3answers
4k views

How to specify skin image path in Knockout HTML template?

I'm trying to add an icon image in the Magento_Paypal/web/template/payment/paypal-express.html template. The icon is located in web/images. I would like to use the equivalent of the following code, ...
11
votes
3answers
4k views

how to save custom field in custom database table while editing product from back-end?

I have created a custom module to display custom tab on product form in back-end. I used this solution. Now on tab i am adding custom fields to save in custom database table. say <input type="...
11
votes
2answers
11k views

Error after deleting all cache in Magento 2

On deleting all cache as rm -rf var/cache/* var/page_cache/* var/view_preprocessed/* var/generation/* I got below error Warning: ltrim() expects parameter 1 to be string, object given in vendor\...
11
votes
3answers
4k views

Magento 2.1 image not uploading in edit form

I am working on magento 2.1 form. Image is uploaded successfully when i add new field. however when i edit any field from grid then file uploader will not shown on page. When i inspect edit page it ...
11
votes
3answers
10k views

JS errors Magento 2

I've been trying to finish something and publish it online this entire weekend, it's some how broken and I have no idea why so I hope someone can help me out. I've tried adding custom jQuery into my ...
11
votes
3answers
4k views

How to save only specific attribute value rather than saving the whole product in Magento2

As you guys already know that we used to have this below method in magento to save a specific attribute value like this. // saving product attribute $product = Mage::getModel('catalog/product')->...
11
votes
3answers
6k views

Add custom product attribute to checkout summary Magento 2

I am trying to add a custom product attribute to the list of items on the summary section in the checkout in Magento 2. The template file is at Magento_Checkout/web/template/summary/item/details.html ...
11
votes
4answers
4k views

Shipping address custom attribute value not display in address box in magento2.2.2

I have added the drop-down custom field on checkout page with custom values. It's working fine also save attribute values in the database but not display in order shipping address.any idea how to show ...