The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [magento-2.1]

Denotes questions related to Magento CE and EE 2.1.x

Filter by
Sorted by
Tagged with
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 ...
11
votes
7answers
12k views

Magento 2.1 How do I create form component field custom depends on another field value?

I have one field select which has some options. One of them will have some fields depend on value, another field will hidden. I have copied and extended component js for my field but it didn't work or ...
5
votes
7answers
4k views

My Custom product tab not displaying in Magento 2

I am trying to inject my custom product tab in storefront on product view page, but it's not displaying. For this I am written below code. registration.php <?php \Magento\Framework\Component\...
22
votes
6answers
24k 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 ...
48
votes
2answers
23k 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 ...
18
votes
2answers
33k 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) ...
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="...
13
votes
4answers
26k 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 ...
7
votes
3answers
4k views

Hide messages after certain interval

How to hide notification messages like success message after adding product to cart or any error messages or notices after few seconds after they appear on the the frontend using knockout js. Example ...
6
votes
1answer
5k views

Notice: unserialize(); Error at offset in Magento 2.2

This code not working in Magento 2.2, But it's working in Magento 2.1. I am facing this error Notice: unserialize(); Error at offset 0 of 168 bytes in /var/www/html/M2/app/code/Vendor/Module/Block/...
16
votes
7answers
17k 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/...
7
votes
7answers
8k views

Magento 2 - Why do SKU not change dynamically in configurable product view page

When you change an attribute in a configurable product the product image changes dynamically but the SKU doesn't change. Also, if you add a configured product to your basket it gives you the image of ...
5
votes
1answer
9k views

Magento 2 add custom validation rule

I'm going crazy here trying to add a custom validation rule to Magento 2. It's impossible to find any useful information about it. The things I have are as follow: 1) requirejs-config.js file with ...
4
votes
3answers
7k views

Magento 2 add Sort By Best Sellers Option on category products litsing page

I am trying to add new custom sort by option on categories products listing page along with other existing options like Name , Position and Price. To test my functionality i am directory doing ...
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 ...
4
votes
2answers
23k views

Get product collection by category id on phtml file magento2 [duplicate]

I want to get product collection by category id on phtml file. For that I used below code but it's not working. $collection = $this->productFactory->create() ->getCollection() ->...
6
votes
1answer
864 views

uicomponent form add new button for modal

I have build a custom form using uicomponent I want to add a button and on click want to open a modal with product grid. How can I achieve this using uicomponent form ?
3
votes
1answer
3k views

Magento 2 Custom Theme : Which files to edit in order to customize home page / category css?

I'm trying to insert some CSS changes, after already inserting the html changes in the "content" part of the Home Page cms page.Changes to category pages will follow the same process, once proven that ...
11
votes
3answers
11k 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 ...
5
votes
2answers
6k views

Magento 2 How to remove shipping method in checkout page

I want to remove shipping method from the cart page and checkout page. I am trying to remove the shipping method from checkout page but seems it's loading from the Knockout.js file. How can i remove ...
4
votes
1answer
1k views

Assign all products in a category to all it's ancestor categories programmatically, in Magento 2

I am working on a Magento 2.1.7 shop and I have created a child-theme of Magento Blank The products are organized into categories and subcategories. In other words, they are organized into parent ...
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
7
votes
1answer
2k views

magento 2 event cataloginventory_stock_item_save_after

I need to detect whenever the inventory level of a product changes. As there is cataloginventory_stock_item_save_after in magento 1.x wanto to implemet same in magento 2.1 <event name="...
1
vote
2answers
4k views

Magento 2 : Is there any way to disable Welcome Email after signup

What is the right approach to disable Welcome Email after completes registration process. I'm using magento2.1. We have an integration with a customer management system and which will sent email to ...
26
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 ...
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/...
7
votes
2answers
5k views

How to add “Buy Now” button in Magento 2.1? [closed]

I need help to add "Buy Now" button on the product detail page. Thanks.
11
votes
4answers
8k 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 ...
5
votes
3answers
7k views

Magento 2 create category attribute thumbnail and upload image using File Uploader Component

I've created a custom module to display category thumbnail image. I've read magento dev doc It is displayed in my category section using category_form.xml <?xml version="1.0" encoding="UTF-8"?&...
5
votes
3answers
2k views

Magento 2: How to add color picker in ui form

I am developing new extension in which I need to add color picker and date picker as well in an admin form. I am developing form using a component. Please check sample screenshot of the form field. I ...
13
votes
3answers
6k 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
1answer
825 views

Reasons to setup cronjob for setup:cron:run and update/cron.php on a deployed production system?

In Magento 2 there are three commands that should be set up as cronjob * * * * * <path to php binary> <magento install dir>/bin/magento cron:run | grep -v "Ran jobs by schedule" >> &...
4
votes
1answer
6k views

How to use bootstrap in my custom theme [duplicate]

In my extended LUMA theme , how to integrate Bootstrap JS and CSS . So I can make my CMS page's layout on Bootstrap grid . Already seen few post here : How to develop theme using twitter bootstrap ...
2
votes
2answers
3k views

Magento 2.1.6 Product Grid page count and record count issue when programmatically adding filter using different methods

I have tried several different methods to artificially add an extra filter to the product grid (Category page). There is an issue where after adding a filter to the product collection, the total ...
1
vote
1answer
944 views

Hiding Shipping Method for current Logged in/Guest user if a condition method

I'm using Magento 2.1. Currently, I'm having two shipping methods. One is UPS and another is Flatrate. If my product's attribute returns true, I want to hide Flatrate shipping method from frontend ...
15
votes
1answer
6k 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 ...
6
votes
1answer
766 views

How to uncheck “My billing and shipping address are the same” checkbox during checkout? One Page/Magento2

I am having an issue where the box is being marked automatically. I want to unmark it.
3
votes
1answer
2k views

Magento admin logo change!

I am trying to change Magento2.2.2 admin logo. But no success. This is what I have done: This file app/design/adminhtml/XXX/yyy/theme.xml contains: <theme xmlns:xsi="http://www.w3.org/2001/...
2
votes
2answers
2k views

Plugin class doesn't exist

I tired to delete an extension and now getting: There has been an error processing your request Plugin class Aheadworks\OneStepCheckout\Plugin\App\FrontController\CoreBridgeInitializer doesn't exist ...
2
votes
1answer
3k views

How to make auto select first child product of configurable product in magento2?

I am trying to make auto select first child product from the configurable product in product detail page. Is this possible?
1
vote
4answers
4k views

Magento 2 : How to display swatches in related products?

I added related products list in product details page. I see there all related products list are display but now i need to display swatches in this list. How can it possible for related products list. ...
26
votes
15answers
38k 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/...
8
votes
1answer
2k views

Magento 2: get a list of all plugins (interceptors) and preferences

Is there a way I can retrieve the list of all plugins (with the methods they're plugged onto) and all preferences (and their original class) on a Magento 2 install.
5
votes
3answers
3k views

Magento 2: move the javascript to the end of the body

As Magento 2 migrated away from Prototype I was expecting that this would be fixed in M2. So, is there a way (easy or not) to move all the <script> tags to the end of the <body> tag ...
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 ...
6
votes
3answers
5k views

Magento 2 - Layered Navigation for Custom Product Collection

I created a CMS page for products that contain a certain attribute (On Sale Items). I extended the ListProduct class and added filters to the product collection to achieve the desired results. (...
10
votes
4answers
5k 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, ...
8
votes
2answers
5k views

Magento2 Need to build Grid with multiple table collection using UI Components

Started on building custom module, it has feature to display the GRID view for which need to join multiple tables in collection and render them on GRID and filters. I have used UI Component from ...
6
votes
4answers
3k views

Undefined index “media_type” while adding image to product's media gallery

Here is the code snippet I use to add an image in a product's media gallery : $sku = 'product-example-sku'; $image_url = 'http://example.com/image.jpg'; $image_ext = pathinfo($image_url, ...
3
votes
2answers
3k views

Magento 2 : get best seller product on daily basis

There are some tables related to bestseller in Magento 2 and it is using following tables to get best product collection. sales_bestsellers_aggregated_daily sales_bestsellers_aggregated_monthly ...