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

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 ...
9
votes
7answers
10k 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
6answers
3k 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\...
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 ...
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 ...
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="...
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 ...
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 ...
7
votes
1answer
4k 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/...
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/...
4
votes
3answers
5k 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 ...
6
votes
3answers
3k 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 ...
3
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 ...
3
votes
1answer
2k 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 ...
4
votes
1answer
1k 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/...
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) ...
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 ...
5
votes
1answer
5k 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
7k 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 ...
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 ...
3
votes
2answers
19k 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() ->...
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 ...
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/...
5
votes
2answers
4k 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.
6
votes
7answers
6k 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 ...
10
votes
6answers
3k views

Migrate data from Magento 1 to Magento 2

Best way to Migrate data from Magento 1 to Magento 2. I found below tools provided by Magento and some third party but don't know exactly which one to follow and what is the best way. Magento tool: ...
2
votes
2answers
3k 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. (...
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 ...
10
votes
2answers
4k views

Magento 2: Move place order button from payment to sidebar on checkout page?

I want to move the place order button from the payment to sidebar on checkout page. Anyone can give me a suggestion? Edit: Is this even possible (with the answer/approach provided)? From my ...
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
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 ...
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="...
2
votes
1answer
1k 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 ...
1
vote
2answers
3k 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 ...
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.
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 ...
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, ...
8
votes
2answers
4k 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
2k 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, ...
5
votes
3answers
6k 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"?&...
4
votes
2answers
2k 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 ...
2
votes
2answers
4k views

Programatically Create Order in Magento 2.1

Has anyone figured out how to programatically create an order in Magento 2.1 yet ? There are a few tutorials kicking around for 2.0 which work nicely but every since I upgraded it no longer works. ...
4
votes
2answers
1k 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 ...
3
votes
1answer
356 views

Admin form using tabs

I'm trying to create an admin form in Magento 2 using UI-components and I want to make it have the M1 look with tabs instead of collapsible fieldsets. I did some digging and found that there are 2 ...
3
votes
1answer
7k views

catch order place after event magento2

I want to catch sales order place after event in magento 2. Here is my events.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
2
votes
2answers
2k views

Exclude caching cusotm module by Magento 2 built in Full page cache(FPC problem)

I am having a strange issue regarding built-in FPC in magento2. I have a custom module, in its index controller, it just renders a phtml file. This phtml file shows some information retrieving it ...
2
votes
3answers
6k views

Set customer group from customer registration form

I was trying to let the customer choose the customer group while the customer registration in magento 2. What i did was, i passed the group id on hidden field like: <input type="hidden" name="...
10
votes
1answer
651 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" >> &...
10
votes
2answers
4k views

Magento 2 get all product attributes without product id

I want to retrieve all product attributes those are available, then convert it to name & value for my select options field. In Magento 1 I can achieve it like this: public function ...
9
votes
3answers
9k views

Magento 2: How to get current language of store?

I'm trying to show a custom block for each store view / language. Therefore I want to create switch statement like: $lang = // Get language code or store view code here; switch ($lang) { case '...