35 votes
Accepted

Static Content is not loading after upgrade

The main issue was caused by the incorrect rewrites work ( as @Marius told ). There was no RewriteBase in my directory pub/static/ and Apache could not find the files because searched for them from ...
user avatar
26 votes
Accepted

Magento 2: How to update order status programmatically in custom module?

You can do it like following way declare below namespace use Magento\Sales\Model\Order; $orderId = 1; //Use constructor injection for Order class. Below $objectManager is just for testing/explanation ...
user avatar
24 votes

Magento 2: How to add additional block on checkout page?

Here I give example to show custom block above shipping method of checkout Create di.xml at app/code/Vendor/Module/etc/frontend/di.xml <?xml version="1.0"?> <config xmlns:xsi=&...
user avatar
  • 21.5k
21 votes

Magento 2: Requested store is not found

I just recently came across this same situation after migrating from Magento 1.6.1.0 to 2.1.4 and hope my answer can be of assistance. The problem came from deleting multiple stores 96 of them to be ...
user avatar
19 votes
Accepted

Magento 2: Requested store is not found

You need to run the following query in your database, and then try to open the website. SET FOREIGN_KEY_CHECKS=0; UPDATE `store` SET store_id = 0 WHERE code='admin'; UPDATE `store_group` SET group_id ...
user avatar
19 votes
Accepted

Knockout If-else condition inside html file in Magento 2

You should write a below code for else condition <!-- ko if: isFreeShipping() --> //My Code goes here <!-- /ko --> <!-- ko ifnot: isFreeShipping() --> //My Code goes here &...
user avatar
15 votes

Magento 2: How to update order status programmatically in custom module?

Order state update To update the order state and and status pro-grammatically in order define the status and state in this format. Initiate order object in the construct function and use that order ...
user avatar
  • 1,276
14 votes

Magento 2: setdata() is not saving the values into the database

Hi guys thanks for the support. Finally i found the solution after searching many sites. In default Magento will try to update the database not insertion when we trying to save the data with the ...
user avatar
11 votes
Accepted

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db.design_config_grid_flat' doesn't exist

Table is missing. Run in sql console below sql query. After run sql query run php bin/magento indexer:reindex CREATE TABLE `design_config_grid_flat` ( `entity_id` int(10) unsigned NOT NULL COMMENT '...
user avatar
  • 2,757
11 votes

How to migrate only orders with Data Migration Tool?

For orders, you will usually need customers as well. I used answer when I first did this. Only run the bin/magento migrate:data command. And with -r if you want to start from scratch. In your ...
user avatar
  • 1,023
10 votes
Accepted

Magento 2: Email Templates Template Style is not Working

First of all, we need to read here: http://devdocs.magento.com/guides/v2.1/frontend-dev-guide/templates/template-email.html#non-inline-styles. For the Non Inline Styles, they must be in a <style ...
user avatar
10 votes
Accepted

Upgrade Magento 2.1.3 to latest 2.1.7

Yes you can directly upgrade your magento version from 2.1.3 to 2.1.7 using composer. It will not create any error if you upgrade it correctly. The reason behind is If you have read release notes -...
user avatar
  • 9,570
10 votes

Magento 2: Display Custom attribute value under the product name on category page

Edit below file app/design/frontend/CUSTOM/THEME/Magento_Catalog/templates/product/list.phtml $attribute = $_product->getResource()->getAttribute('attribute_code'); // Get Value $...
user avatar
9 votes

Update checkout summary on selecting shipping method

You just need to add the following file to your theme on path: [theme]/Magento_Checkout/web/js/action/select-shipping-method.js define( [ '../model/quote' ], function (quote) { "use strict"...
user avatar
9 votes
Accepted

Importing products with custom options

Custom options are processed in \Magento\CatalogImportExport\Model\Import\Product\Option::_parseCustomOptions() There is line 1859 $options[$name][$k]['_custom_option_store'] = $rowData[Product::...
user avatar
  • 788
8 votes

Static Content is not loading after upgrade

If you are running Nginx, here is the fix. You probably have your own conf file, you need to update the /static/ part with this, they have updated part of it specifically: # Remove signature of the ...
user avatar
8 votes

Magento 2: How to update order status programmatically in custom module?

Since load() and save() are deprecated now (because :) * @deprecated 100.1.0 because entities must not be responsible for their own loading. * Service contracts should persist entities. Use resource ...
user avatar
  • 554
8 votes

Magento 2: change shipping address form fields order

This can be achieve two way. First,by changing ui item's sortOrder field value of those field at checkout_index_index.xml. <item name="country_id" xsi:type="array"> <item name="sortOrder"...
user avatar
  • 75.5k
7 votes

Static Content is not loading after upgrade

Go to the database and insert a row in core_config_data table: INSERT INTO core_config_data (scope, scope_id, path, value) VALUES ('default', 0, 'dev/static/sign', '0');
user avatar
  • 1,685
7 votes

Magento 2: How to add additional block on checkout page?

This is what I did to display a CMS block on checkout page under sidebar. 1. In the templates/onepage.phtml I created a js variable to hold the cms block content like this: <?php $myCmsBlock = $...
user avatar
7 votes

cannot read property 'section loadurl' of undefined

The data that code references (sectionLoadUrl) is usually set in the following snippet that (should) be on every Magento front-end page <script type="text/x-magento-init"> {"*":{"...
user avatar
  • 43.5k
7 votes
Accepted

Store switcher not showing in frontend magento 2

This is because you have created two websites, for the store switcher to display you need at least 2 store views under the website. So you should have it configured like this: Website Indian Store ...
user avatar
  • 15.2k
7 votes
Accepted

Magento 2 : How to delete the record in custom table?

I think the best way just follow Magento standard. For example just check Cms magento module. So you have a new module app/code/MyCompany/MyModule Model/Comment.php namespace MyCompany\MyModule\...
user avatar
7 votes

magento 2 : which tables is used while creating configurable product

Configurable products manage by below tables catalog_product_super_attribute : holds the configurable attributes. catalog_product_super_attribute_label : holds the store view labels for the ...
user avatar
7 votes

Knockout If-else condition inside html file in Magento 2

Just to extend a bit on Suresh Chikani's answer to include more combinations under this question: To do a if-elseif-else construction you would have in PHP: if (A && B) { //...code } ...
user avatar
  • 7,342
6 votes

Magento 2: Requested store is not found

This generally happens whenever config.php and the database get out of sync. For example, whenever I import a database back to my local development environment. Here were the steps I used to ...
user avatar
6 votes
Accepted

Extend NewAction Controller in Magento 2 Newsletter Vendor module

You will need to override this controller below: vendor/magento/module-newsletter/Controller/Subscriber/Confirm.php To do that you will need to create your custom module with this configurations: ...
user avatar
6 votes
Accepted

How do you get the new product ID after programmatically creating the product?

Okay, here's the situation: Because of how the product save works, $this->_productRepository->save($newProduct); does not reflect changes back onto your $newProduct. It's actually creating a new ...
user avatar
  • 11.9k
6 votes
Accepted

How to migrate only orders with Data Migration Tool?

Apologizes for late reply and this was FINAL solution that worked for me. Config.xml file: <steps mode="data"> <step title="Customer Attributes Step"> <integrity>...
user avatar
  • 4,647
6 votes
Accepted

Hide or remove all breadcrumbs from frontend

You can remove it from default.xml file of your theme: <referenceBlock name="breadcrumbs" remove="true" /> Path to file: root/app/design/frontend/VENDOR/YOUR_THEME/Magento_Theme/layout/...
user avatar
  • 4,647

Only top scored, non community-wiki answers of a minimum length are eligible