2

Please replace your code with below code. <?php $curr_url = $_SERVER['REQUEST_URI']; $exp_url = explode('/', $curr_url); //print_r($exp_url); $classType = 'tool-another'; if(!empty($exp_url) && isset($exp_url[2]) ) { if($exp_url[2] == 'xyz.html' || $exp_url[2] == 'xyz'){ $classType = 'xyz'; } elseif($exp_url[2] == 'abc.html' || $...


1

Change below code it seems double quote is not proper ”removeItem” to "removeItem" And below one as well: ”addLinkRel” to "addLinkRel"


1

As of Magento 2.3 it is no longer best practice to use flat catalog at all. Detailed info and justification for this is a little thin on the ground right now (updates should be made to answers here to reflect when more info is found.) Apparently, this is specifically for performance reasons. As this question is related to performance, this is relevant. ...


1

You have to have created a module to show a current category on the product page. Check below files app/code/Vendor/Module/registration.php <?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, 'Vendor_Module', __DIR__ ); app/code/Vendor/Module/etc/module.xml <?xml ...


1

If you want to get the current product category id then use below code NOTE: Please do not use the Object manager <?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $product = $objectManager->create('Magento\Catalog\Block\Product\View')->getProduct(); $categoryId = $product->getCategoryId(); $category = $objectManager-&...


1

I saw this happen when a group by statement is added to the product collection. If this is the case, you can create an after plugin for the product collection that looks like this public function afterGetSelectCountSql( \Magento\Catalog\Model\ResourceModel\Product\Collection $subject \Magento\Framework\DB\Select $select; ) { $select->reset('...


1

You should delete all the rows which have store # 0 in the table catalog_category_entity_int, catalog_category_entity_varchar, catalog_category_entity_text, catalog_category_entity_decimal, catalog_category_entity_datetime


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