All Questions
2,007 questions
91
votes
30
answers
138k
views
Required parameter 'theme_dir' was not passed
What is the error message:
Required parameter 'theme_dir' was not passed
Is it related to in Magento 2? And how can this problem be fixed?
81
votes
4
answers
30k
views
Fundamentals for debugging a Magento store
How can I debug my Magento store
This is a question that isn't all too relevant to us now, but had a Magento SE site existed 5 years ago, it probably would have been our first question. For those ...
40
votes
1
answer
35k
views
How do you override LESS in a custom theme?
I've spent the better part of this week trying to find a clear guide on how to properly create a custom theme and extend exist LESS/CSS without having to copy the entire magento-blank theme.
The ...
38
votes
2
answers
11k
views
Magento 2 - Theme Type 0:physical, 1:virtual, 2:staging. When to use?
In the theme table there is a type field with 3 possible values: physical, virtual and staging.
When to use physical virtual and staging theme?
When I extended luma theme my new theme appear in ...
36
votes
7
answers
37k
views
Move all Javascript includes to before </body>
Does anyone know how to have all of Magento's JS script tags e.g. <script type="text/javascript" src="http://sitename.com/js/prototype/prototype.js"></script> render out before the closing ...
32
votes
2
answers
94k
views
How to use jquery library in Magento 2?
I am creating a Magento theme where I need to include jQuery.
When I add this <link src="js/jquery-1.7.1.js"/> in head. It is working but Magento javascript functions are not working. How to ...
30
votes
5
answers
25k
views
Get product attribute in cart in Magento2
I'm trying to grab a product attribute in the cart template. But I just does not work! The attribute is set to Visible on Catalog Pages on Storefront = yes and Used in Product Listing = yes
I use a ...
30
votes
4
answers
20k
views
Theming for Magento 2 - Starting from scratch
Some of you probably read that topic regarding theming from scratch for Magento 1: Theming - starting from scratch
I was wondering, what would be the best practice to develop a theme from scratch for ...
30
votes
2
answers
7k
views
Theming - starting from scratch
What is the preferred method of beginning a full site build, from scratch? My builds typically begin from fully mocked-up HTML5 wireframe pages, and we plug in functionality from there.
But, part of ...
29
votes
3
answers
32k
views
How to implement translations in design template package CSV's? How does echo $this->__('Text') work?
I have a design package setup like so:
design/frontend/package_name/theme_name/locale/
under which I have
de_DE, en_GB etc, under which I have corresponding translate.csv files with the various ...
27
votes
4
answers
13k
views
Why do classes use a helper for translation instead of $this?
In core modules and sometimes templates, I see helper classes being used for translation:
Mage::helper('someModule')->__('translate me');
Why is this preferable to:
$this->__('translate me');
26
votes
4
answers
27k
views
Magento 2: requirejs-config.js in themes?
Is it possible to include a requirejs-config.js file (or otherwise configure RequireJS) via a Magento theme? Or is the capability reserved for Magento modules? The dev docs information on theme ...
26
votes
3
answers
5k
views
When to use 'name' and when to use 'as'
I've found that when trying to use the unsetChild method, sometimes I have to use the 'name' attribute and others 'as'. It seems that if a block is added normally, you use 'as' but if it is added to ...
25
votes
4
answers
22k
views
how to create multilingual static block
I need to create multilingual static block. So far I have created static block with id 'delivery_returns'.
I'm calling it in catalog\product\view.phtml like this:
$deliveryBlock = Mage::getModel('...
24
votes
4
answers
23k
views
Something went wrong while saving this configuration: Area is already set
I am unable to apply a new theme in a clean install of 2.2.4. Upading to 2.2.5 does not fix the problem.
24
votes
4
answers
57k
views
How to add translations for new words in Magento?
I'm using English, Spanish and German as three store views for my site. What is the easiest way to add translations for new words?
Even if I add new words with the translations it doesn't show in the ...
23
votes
5
answers
13k
views
Managing Magento csv Translation Files
As time has passed, the Magento core team has added more and more default language packs to the
app/locale
folder. Is there a canon way to manage your own translation files such that they don't ...
23
votes
4
answers
45k
views
Best Practices Way to Edit Magento Top-Links
Let's say we want to add a shopping cart icon right before the "My Cart" link on Magento's top links (see top links below).
What is the best way to do this?
Do something to toplinks.php?
Do ...
21
votes
8
answers
62k
views
How to override .phtml files in Magento 2
I want to customize product details page, So it required to override some .phtml files in following locations.
So I want to know, how to override .phtml files in vendor\magento\module-catalog\view\...
21
votes
2
answers
7k
views
Difference between <remove name=”" /> and <action method=”unsetChild”> in layout
What is the difference between <action method=”unsetChild”> and <remove name=""/>?
Both functions are used to remove a block from the layout.
Could someone explain with an example?
20
votes
2
answers
6k
views
What does the "exclude" Tag in Magento 2's view.xml file do
The Magento 2 "blank" theme includes the following tag hierarchy.
<exclude>
<item type="file">Lib::jquery/jquery-ui-1.9.2.js</item>
<item type="file">Lib::jquery/...
20
votes
1
answer
12k
views
Best way to extend module less found in web/css/source/module, like _minicart.less?
Which is then the best way to extend less files content in <module>/web/css/source/module/, like for instance Magento_Checkout/web/css/source/module/_minicart.less?
Assuming that to
A) ...
19
votes
3
answers
2k
views
Magento Adding a new Language?
I've looked at several pages regarding adding another language support to the Magento cart, however, there seems to be something missing.
The usual is to download translation through the admin ...
18
votes
4
answers
19k
views
Magento2.1.0 showing error Required parameter 'theme_dir' was not passed while saving product in admin
I am facing this error Required parameter 'theme_dir' was not passed when i try to save the product in admin. I checked the theme configuration it was assigned to the stores. Recently i have upgraded ...
18
votes
5
answers
7k
views
Magento Displaying appropriate localisation based on Location
I'd like to configure the Magento site to be able to recognize the default language and location of the user and display the site in that language and with appropriate localization.
For example:
A ...
18
votes
1
answer
3k
views
How to hole-punch full page cache without custom module
Our full page cache seems to be based on session. If I open an incognito window with chrome and visit one of the pages, it warms the cache, and the second page load is much faster, however, if I close ...
17
votes
4
answers
88k
views
Current Skin Url
I want to get skin URL of my current theme. At present I am working in Magento "rwd" theme.
And I am using below code to get skin URL:
Mage::getDesign()->getSkinUrl();
This returns me URL http://...
17
votes
4
answers
5k
views
Magento2 localisation Javascript
A similar question was already asked here: Magento 2 javascript text translations, but Magento updated this translation technique in the beta version.
How can I add or update translations used by ...
16
votes
5
answers
34k
views
Why does my translate.csv and the translation files not work?
I'm trying out a new theme and it seems to not get the translations properly.
If I search for the English phrase in my files, I can find:
"You have no items to compare.","Sie haben keine Artikel ...
16
votes
3
answers
4k
views
Magento2 design fallback logic
We already know design fallback logic from Magento 1.x:
Current package / Current Theme
Current Package / Default theme
Base Package / Default theme
Now. i want to know What is the design fallback ...
15
votes
2
answers
12k
views
What is the correct way/approach to modify a Magento template?
Please suggest me the right approach, I want to customize the "EMAIL to Friend" page into pop up window, when user click on the button (email this product). By enabling template hinting, I found out ...
15
votes
1
answer
7k
views
Make magento core template use my module's translation file
In an extension I'm working on, I have a layout XML added via module's config.xml. This layout has some modifications to the frontend. Some of these blocks, however, belong to Magento core modules. ...
14
votes
3
answers
10k
views
Magento 2 custom theme layout xml and css not working
I created a new theme and it was working fine but after a few days, I realized some things weren't working.
default_head_blocks.xml is no longer pulling in any css files that I include (both hosted ...
14
votes
4
answers
30k
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 ...
14
votes
3
answers
2k
views
Is there a local theme layout XML file other than local.xml?
I've built a theme by creating and editing the following file:
frontend/mypackage/default/layout/local.xml
I have a store view "site1", and wish to make exceptions on the default local.xml of "...
14
votes
3
answers
12k
views
magento 2: 'i18n:collect-phrases' command creates different csv files
php bin\magento i18n:collect-phrases -o "C:\xampp\htdocs\magento\app\design\i18n\xx_YY.csv" -m
collects all phrases in the magento application and outputs a csv file with 4 columns:
php bin\magento ...
14
votes
2
answers
6k
views
Correct way to Update a Theme's Parent in Magento 2
In Magento 2, you can specify a parent theme in a theme's theme.xml file.
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/...
13
votes
7
answers
23k
views
How to remove Company field from checkout process in Magento 2?
How to remove Company field from checkout process in Magento 2? I've been looking for the template but have not found it.
Update: Is there any way to remove this field via layout or template?
13
votes
3
answers
16k
views
Magento2: Default to sort by price descending not ascending
Ok so I have my categories sorting by price. Magento 2 defaults this to price ascending. But I would prefer it to be by price descending.
Pretty sure I can do this by customising ...
13
votes
2
answers
11k
views
CMS XML Handles for Layout Updates
I've had a few scenarios where I've tried to use the cms handles to update a cms page's layout. For example I was trying to use the cms_index_index handle referencing root and setting the page ...
13
votes
2
answers
5k
views
Magento 2: what does i18n mean?
When I started working with Magento 2, that was the first time I came accross this abbreviation so I have no idea what does that word/abbreviation mean ?
13
votes
1
answer
15k
views
How to extend the Luma Theme? [duplicate]
I am trying to extend the Luma Theme in Magento 2,
But it does not work as expected.
I added my Theme,
let it extend from Luma,
flushed all Caches,
Published all Statics and activated the ...
13
votes
1
answer
2k
views
Multiple local.xml layout files in a package
Say there are two themes in a package:
Base (Set as default)
Child (Set as main theme)
Both contain a local.xml in the layout folder - Only the local.xml from the Child theme will be loaded, so any ...
12
votes
6
answers
48k
views
Magento 2 Translations not working
I'm trying to translate some text in the checkout page:
"Provided Zip/Postal Code seems to be invalid."
However, when I add the following to frontend/..theme../Magento_Checkout/i18n/en_US.csv and ...
12
votes
6
answers
51k
views
How to call Owl Slider in Magento2
If we want to add Owl Slider in Magento 1.X then we follow the below steps.
Copy owl.carousel.min.js and owl.carousel.js and paste into skin/frontend/pakage_name/theme_name/js
Copy owl.carousel.css ...
12
votes
4
answers
15k
views
Magento boilerplate / blank / skeleton / naked themes for theme development
Does anyone out there know of a good, clean boilerplate / blank / skeleton / naked theme (unsure of the proper term myself) besides the base/default? Not that it is bad, but sometimes another one may ...
12
votes
2
answers
10k
views
How to add "Empty Cart" button to minicart
How can you add an "Empty Cart" button to the minicart in Magento 2.
Is it possible with layout xml?
12
votes
3
answers
2k
views
Translate Maintenance mode per website in multiwebsite-multidomain setup
Translate Maintenance mode per website in multi website-multi domain setup
What is the proper way of translating (localisation) Maintenance page in a multi-website and multi-domain environment?
...
12
votes
2
answers
613
views
How to handle translations with translation bureaus?
I'm wondering what's the best way to realise translations with translation bureaus.
Basically I see two ways of doing this:
Send them the CSV files.
Give them access to a Magento installation for ...
11
votes
2
answers
22k
views
How to override translate csv files in magento2
Suppose, I want to translate Shop By to Shop in my custom theme using translation file en_US.csv
What is the method or procedure to achieve it in Magento2?