In this article, I am going to explain how to apply the theme in Magento 2. If you reading my article for the first time, I suggest you read my previous article on Theme Concept in Magento 2, Layout Overview in Magento 2, and Configure Theme Properties in Magento 2.
In previous articles, we have successfully created a theme. Now I am going to show step by step process to apply the theme to a storefront.
Step 1: Login Magento Admin > Content > Configuration
Step 2: Design Configuration > Click on edit
Step 3: Select Theme > Save Configuration
Step 4: Flush Magento Cache
$ php bin/magento c:f $ php bin/magento c:c
Now, we have successfully applied the theme for the storefront.
Check if your theme applied to the storefront or not?
In the above picture, you can see our theme “Aryan_Tutorial” is applied on the storefront.
Apply different Theme for User-agent :
As per requirement, sometimes we have to set different themes for the user agents. For example, we will apply the “Magento Luma” theme for mobile:
Magento Admin > Content > Configuration > Click edit > Add New User Agent rule > Save Configuration
After the above configuration, do Magento cache flush.
APPLY A TEMPORARY THEME CONFIGURATION TO A STORE VIEW
What is the purpose of temporary theme?
This is to automate the design change on specific occasions. For example, if we want to configure a different theme for three days on the occasion of HOLI.
How does it affect rendering if a design change is scheduled?
On the selected day, the theme is applied to the storefront as a primary theme. On the end day, it automatically changed to the Main theme.
Note: Only one design change can be scheduled at a time. Magento does not allow scheduled multiple designs to change at a time.
Step 1: Admin > Content > Schedule
Step 2: Store Design Schedule > Fill entry > Add Design Change
You can schedule your change here, under Store select your store where need to change the design, Design select your theme ( scheduled theme ), Date From is the start day of design scheduled, and Date To is the end date.
If you like this article, you can buy me a cup of coffee Buy me a Coffee.