Skip to main content
Share Your Experience: Take the 2024 Developer Survey
37 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 ...
Siarhey Uchukhlebau's user avatar
28 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=&...
Prince Patel's user avatar
  • 22.7k
27 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 ...
Dhaval Solanki's user avatar
22 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 ...
Yamaha32088's user avatar
21 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 &...
Suresh Chikani's user avatar
20 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 ...
Dhiren Vasoya's user avatar
16 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 ...
gelanivishal's user avatar
  • 1,336
16 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 ...
Selva Kumar's user avatar
12 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 ...
Khoa TruongDinh's user avatar
12 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 '...
St3phan's user avatar
  • 2,907
12 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"...
Chiriac Victor's user avatar
12 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 ...
medmek's user avatar
  • 754
12 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 ...
Suresh Chikani's user avatar
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 ...
tread's user avatar
  • 1,083
10 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::...
yaronish's user avatar
  • 798
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 -...
Manthan Dave's user avatar
  • 9,826
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 $...
Abhishek Panchal's user avatar
9 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 ...
Kevin Chavez's user avatar
9 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 ...
Silas Palmer's user avatar
9 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"...
Amit Bera's user avatar
  • 77.6k
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');
Saphal Jha's user avatar
  • 1,873
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 = $...
Siju Joseph's 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"> {"*":{"...
Alana Storm's user avatar
  • 44.4k
7 votes

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

Thanks to @medmek and @prince-patel answer. As question from @jafar-pinjar regarding custom order status, setState and setStatus calls can take on Status Code. For example, custom status code "paid" ...
qgor's user avatar
  • 81
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 ...
Ben Crook's user avatar
  • 15.7k
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\...
Nicholas Miller's 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 } ...
7ochem's user avatar
  • 7,552
6 votes

How Can I apply server side validation in magento 2

You can use server side validation as below: if (!\Zend_Validate::is(trim($post['name']), 'NotEmpty')) { $error = true; } if (!\Zend_Validate::is(trim($post['comment']), 'NotEmpty')) { $...
Prashant Valanda's 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: ...
Rafael Corrêa Gomes's 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 ...
Ryan Hoerr's user avatar
  • 12.3k

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