Hi all,
After a custom theme install products doesn't show in categories page but they appears in search.
When I try to revert to Luma products appears again.
Magento version: 2.4.4
Hello -
Please make sure of the following things:
1- Product Enabled.
2- Product Assigned to the category and the category is enabled.
3- Make sure product visibility set to catalog and search not search only
4- Make sure the product is "In Stock" with Qty more than 0.
5- Make sure to run re-indexing and cache flush.
Let me know if these are already set.
Hello @romitomatt0932
Steps to Create Child Theme in Magento 2
Step 1:Create a child theme folder with the following naming convention {parent-theme-name},_child, in the folder path:
app/design/frontend/{Vendor Name}/{Theme Name}
Step 2:
Create the file theme.xml in the child theme folder in the given path app/design/frontend/{Vendor Name}/{Theme Name}/theme.xml to specify the parent theme. This is an important step, so we set the value as Magento/Luma.
Now add the code as:
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>{Custom Theme Name}</title>
<parent>Magento/luma</parent>
<media>
<preview_image>media/preview.png</preview_image>
</media>
</theme>
Step 3: Create the registration.php file in the theme folder app/design/frontend/{Vendor Name}/{Theme Name}/registration.php to register your child’s theme.
Now paste the following code:
<?php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::THEME,
'frontend/{Vendor Name}/{Theme Name}',
__DIR__
);
Step 4: Create composer.json at the given path: app/design/frontend/{Vendor Name}/{Theme Name}/composer.json
{
"name": "{Vendor Name}/{Theme Name}",
"description": "N/A",
"require": {
"php": "~5.5.0|~5.6.0|~7.0.0|~7.1.0|~7.2.0|~7.3.0|~7.4.0|~8.1.0",
"magento/luma": "100.0.*",
"magento/framework": "100.0.*"
},
"type": "magento2-theme",
"version": "100.0.1",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"autoload": {
"files": [
"registration.php"
]
}
}
Step 5: Create a web directory with the following empty directories and files inside the child theme. The whole directory structure for the child theme looks like this.
Step 6: You can now enable and customize the theme in Magento. Go to the Magento root folder in your terminal and deploy static content using the following command:
bin/magento setup:static-content:deploy -f
php bin/magento cache:clean
php bin/magento cache:flush
Step 7: Override Theme Layout
For overriding the theme layout, you need to put the layout file with the same name in the following location:
/app/design/frontend/Magento/luma/Magento_Theme/layout/default.xml OR vendor/magento/theme-frontend-luma/Magento_Theme/layout/default.xml
These files override the following layouts:
/{Vendor}/{Theme Name}/Magento_Theme/layout/default.xml
For overriding the catalog category page layout, you need to put the layout file with the same name in the following location:
/app/design/frontend/Magento/luma/Magento_Catalog/layout/catalog_category_view.xml OR /vendor/magento/module-catalog/view/frontend/layout/catalog_category_view.xml
These files override the following layouts:
/{Vendor}/{Theme Name}/Magento_Catalog/layout/catalog_category_view.xml
Hopefully, it will work for you.
If you find our reply helpful, please give us kudos.
An award-winning North American Magento Development Agency That Delivers Powerful Results, Innovation, and Secure Digital Transformation.
WebDesk Solution Support Team
Get a Free Quote | | Adobe Commerce Partner | Hire Us | Call Us 877.536.3789
Thank You,
WebDesk Solution Support Team
Get a Free Quote | Email | Adobe Commerce Partner | Hire Us | Call Us 877.536.3789
Location: 150 King St. W. Toronto, ON M5H 1J9
@nkhleif wrote:Hello -
Please make sure of the following things:
1- Product Enabled.
2- Product Assigned to the category and the category is enabled.
3- Make sure product visibility set to catalog and search not search only
4- Make sure the product is "In Stock" with Qty more than 0.
5- Make sure to run re-indexing and cache flush.
Let me know if these are already set.
Yes, I've checked and all of these are already set.
In Luma theme the products shows!