Hot answers tagged

119 votes

Required parameter 'theme_dir' was not passed

Just in case if you are removing theme directly(Not in Magento way). Then follow these steps. STEP 1 : File Operations Delete the content from app/design/frontend/<Vendor> (make sure you ...
Kaushal Suthar's user avatar
81 votes
Accepted

Get product attribute in cart in Magento2

There is no necessity to change any PHP code for doing this. You just need to create {MODULE_NAME}/etc/catalog_attributes.xml with such content: <?xml version="1.0"?> <config xmlns:xsi="...
Igor Sydorenko's user avatar
75 votes
Accepted

How to use jquery library in Magento 2?

If you are adding your custom js library other than jQuery then you need to include the js code inside require function like: require(['jquery', 'jquery/ui'], function($){ //your js code here ...
Shaheer Ali's user avatar
  • 2,355
74 votes
Accepted

How do you override LESS in a custom theme?

Note 1: This will always assume you are extending magento-blank. Note 2: <theme-dir> is app/design/frontend/Vendor/theme/ The basics: Changing Base Variables (for tl;dr, skip to conclusion) ...
andyjv's user avatar
  • 3,232
66 votes

Magento 2 custom theme layout xml and css not working

Check your DB. There is a table called theme that stores a reference to all the themes that have ever been installed in your store. If the type of the theme is set to 1, that means Magento sees the ...
circlesix's user avatar
  • 4,273
54 votes
Accepted

Something went wrong while saving this configuration: Area is already set

Note : This is a know issue in Magento 2.2.4 (see GitHub issue) and below fix is just a temp fix. You should not directly change the Magento core file (override or create a plugin) Change in Magento\...
Vishwas Bhatnagar's user avatar
50 votes
Accepted

Theming for Magento 2 - Starting from scratch

TL:DR Do you build using the native luma or blank theme ? Or anything else ? This is up to you, declaring a parent theme is optional. If you don't declare a parent you will still fallback to the ...
Ben Crook's user avatar
  • 15.7k
45 votes

Magento2.1.0 showing error Required parameter 'theme_dir' was not passed while saving product in admin

This error appears when you remove a template folder, which is still referenced in the database. The simplest way to fix it is, go to the database, and in table 'theme', find the theme name which does ...
Vu Anh's user avatar
  • 1,036
44 votes
Accepted

Magento 2 - Theme Type 0:physical, 1:virtual, 2:staging. When to use?

There's 3 different types defined in Magento/Framework/View/Design/ThemeInterface: Physical type Virtual type Staging type Physical themes Physical refers to the fact that those themes are defined ...
Raphael at Digital Pianism's user avatar
35 votes
Accepted

Required parameter 'theme_dir' was not passed

This error message means that you have a theme configured which doesn't exist on the file-system (any more). It can be easily fixed by selecting a valid theme instead. Go to Content -> Configuration, ...
hakre's user avatar
  • 2,821
29 votes

How to override .phtml files in Magento 2

Sometimes we need to make modifications to existing templates. Instead of making changes directly to existing template files, we should override them in our own theme. Let us assume that we want to ...
Arunendra's user avatar
  • 7,436
27 votes
Accepted

Magento2: Default to sort by price descending not ascending

Copy the file: vendor/magento/module-catalog/view/frontend/layout/catalog_category_view.xml to app/design/frontend/{{Vender_Namespace}}/{{Theme_Name}}/Magento_Catalog/layout/...
circlesix's user avatar
  • 4,273
20 votes

how to create custom layout page in custom theme

Your question is very brief, it sounds like you're trying to create a new page layout? If that's correct you need to also declare it in layouts.xml. Official documentation How to Create a Custom ...
Ben Crook's user avatar
  • 15.7k
20 votes
Accepted

How to override blocks in v2.1

Override block: Create your own module under app/code folder. We can use preference to override the class in Magento 2. app/code/Vendor/Module/etc/di.xml <?xml version="1.0"?> <config ...
Khoa TruongDinh's user avatar
19 votes
Accepted

How to change default logo of magento admin panel

There is no setting to change Magento's backend logo. If you want, you can change it by replacing at: <magento_root>/pub/static/adminhtml/Magento/backend/en_US/images/magento-logo.svg Note: ...
Mohit Kumar Arora's user avatar
19 votes
Accepted

How to add Qty in add to cart form on Product Listings Page in Magento 2

On this form just add below code <input type="number" name="qty" id="qty" maxlength="12" value="<?php /* @escapeNotVerified */ echo '1' ?>" title="<?php /* @escapeNotVerified */ echo __('...
Amit Bera's user avatar
  • 77.3k
19 votes
Accepted

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

According to Magento 2 conventions, the best way to extend module styles is as follows: If we want to extend styles from Magento_Checkout/web/css/source/module/_minicart.less we need to have 2 files ...
Jalogut's user avatar
  • 790
18 votes

Magento 2: requirejs-config.js in themes?

OK, I think I may have solved it and I believe that the documentation is ambiguous and needs updating to clarify the process. I moved my requirejs-config.jsfrom within the web/js and web directories ...
Gareth Daine's user avatar
18 votes
Accepted

How do you give multi-stores different themes in Magento 2?

When new Website or store view created you have to run the following command in your commandline, php bin/magento indexer:reindex Once this done, you can able to see your new store in design section ...
seeni's user avatar
  • 1,247
18 votes
Accepted

Magento 2, issue with getting "version" number in file paths

We can disable it in Admin: Stores > Configuration > Advanced > Developer > Sign Static Files Or we can change directly the value in core_config_data: insert into core_config_data (config_id, ...
Khoa TruongDinh's user avatar
17 votes

How to remove Company field from checkout process in Magento 2?

Temporarily, we should try: <item name="company" xsi:type="array"> <item name="visible" xsi:type="boolean">false</item> </item> For example, in app/design/frontend/{...
Khoa TruongDinh's user avatar
17 votes
Accepted

How to add "Empty Cart" button to minicart

I have just created a proper module for your question: We need to declare the custom js component and html template: app/code/Vendor/MiniCart/view/frontend/layout/default.xml <?xml version="1.0"?...
Khoa TruongDinh's user avatar
15 votes

How to enable custom admin theme in Magento 2

Thank you @Alex! Your solution worked for me! I can see from the source that admin area is using my theme now. Steps: create a new theme in app/design/adminhtml/Vendor/Themename. In that directory, ...
Kampaviineri's user avatar
15 votes
Accepted

Why use a theme when you have modules?

You can do anything you fancy, but if it is the right thing to do that is the question here. Modules Modules should add or change functionality of the webshop and should/could be transferred to ...
7ochem's user avatar
  • 7,532
14 votes

Required parameter 'theme_dir' was not passed

This problem can also occur when you're in an emulated state, for example in a CLI command. I had a situation where I could not send an e-mail in the CLI, because the wrapping command was running in ...
Giel Berkers's user avatar
  • 12.2k
14 votes
Accepted

Magento 2: requirejs-config.js in themes?

you can actually include a require-config.js in your themes Module dirs. The problem is (actually for our frontend team) that there seems to be no possibility, to override the config, but to extend ...
David Verholen's user avatar
14 votes

how to change block ordering in layouts

To position elements you also need to add before="" or after="" when you define or move a block. But please note the block you are referencing in before or after must share the same parent as the ...
Ben Crook's user avatar
  • 15.7k
14 votes
Accepted

How to get store config inside a theme template

I suggest you create your own block, which will extend the Magento\Framework\View\Element\Template class. As the Magento\Framework\App\Config\ScopeConfigInterface is part of Magento\Framework\View\...
Raphael at Digital Pianism's user avatar
14 votes
Accepted

Magento 2: How to move Details tab to product info column?

We should take a look at: vendor/magento/module-catalog/view/frontend/layout/catalog_product_view.xml line 103 ~ 118 <block class="Magento\Catalog\Block\Product\View\Description" name="product....
Khoa TruongDinh's user avatar
14 votes

How to override footer template in a custom theme

The configuration of the footer can be seen in this file: vendor/magento/module-theme/view/frontend/layout/default.xml I was able to modify the footer declaration by creating my own default.xml file ...
Ryre's user avatar
  • 1,147

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