New answers tagged

0

The following approach works fine for me to resolve below issue. "URL key for specified store already exists." Step : 1 First, I have find out the above message by using grep command. Basically below vendor core file throws this message. File Name : Magento\UrlRewrite\Model\Storage\DbStorage.php Step 2 : Added below log code in the doReplace() ...


1

I had the same problem on mobile and i resolve it with CSS. #mana_ajax_wrapper_category_products_list .toolbar-products:last-of-type, #mana_ajax_wrapper_search_result .toolbar-products:last-of-type{ .open-filters{ display: none; } }


1

You should use minicart knockout, otherwise cache will be a problem. Just name the scope different like 'cart_check'. In your list.phtml <div data-bind="scope: 'cart_check'"> <!-- ko ifnot: getCartParam('summary_count') --> <div class="block-content no-display" data-bind="css: {'no-display': getCartParam('...


0

Maybe below is the simple way in any list.phtml file. $cartHelper = $this->helper(Magento\Checkout\Helper\Cart::class); if ($cartHelper->getItemsCount() === 0) { // write your code }


0

<referenceContainer name="content"> <block class="Magento\Catalog\Block\Category\View" name="category_banner" template="category/banner.phtml" ifconfig="porto_settings/category/category_description" before="-"/> </referenceContainer>


0

You can enable / disable title translations in theme configuration: Content -> Design -> Configuration -> Header -> Translate title (yes/no)


0

I have fixed it by run command lines: php bin/magento module:enable --all php bin/magento setup:upgrade php bin/magento setup:static-content:deploy -f php bin/magento cache:flush php bin/magento indexer:reindex catalogsearch_fulltext Hope it helps someone!


0

Please execute bin/magento cache:flush && bin/magento index:reindex so that the information on out of stock products is added to Elasticsearch as new documents.


1

Copy following code in your phtml file: <?php $yourCatIds = array(1,2,3...); $productCats = $_product->getAvailableInCategories(); if (count(array_intersect($yourCatIds,$productCats))) { echo '<li>' . $_product->getData('attributecode') . '</li>'; } ?>


0

You can check if your product belongs to a specific special category id : <?php $productCategoryIds = $product->getCategoryIds(); $specialCategoryId=3; ?> <?php if (in_array($specialCategoryId,$productCategoryIds)): ?> <div style="margin-bottom:10px;"> <p><i style="font-style:italic;">A ...


0

1)Create a Block and add following code: <?php namespace vendor\Category\Block; class Category extends \Magento\Framework\View\Element\Template { public function __construct( \Magento\Framework\View\Element\Template\Context $context, \Magento\Catalog\Api\CategoryRepositoryInterface $categoryRepository, array $data = [] ) { ...


0

Not with the Magento OOTB, the only workaround I know of is to create a static block and use it inside a widget added in the 'Sidebar Main' container: But this means you will have fixed links/ filters and not a dynamic set of filters.


Top 50 recent answers are included