New answers tagged

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

I figured it out. Found the answer in this file: vendor\magento\module-grouped-product\Block\Product\View\Type\Grouped.php public function getAssociatedProducts() { return $this->getProduct()->getTypeInstance()->getAssociatedProducts($this->getProduct()); }


-1

You can add product collection filters in below path vendor/magento/module-catalog/view/frontend/templates/product/list.phtml <?php if($_product->getTypeId() != "configurable"): ?> add this filter in your code so the configurable product will not appear on the list page.


-1

I suggest you change the visibility of the products to either Search if you still want them to be shown in the search results page OR check this thread "Not Visible Individually" products disaply on Frontend in Magento2.4 where I detailed some workarounds to exclude products from listing, but still have them available at direct access by its URL.


0

I got this issue when I logged in as a non-admin role and have partial access to the resource. If you are not an admin user, try logging in as admin and see if the issue persists. If the issue only shows up in the non-admin role, you can start enabling some related resource in System -> User Role (in your case, you can try enabling all product-related ...


0

Check which version of Elastic is selected in the admin panel Stores -> Configuration -> Catalog -> Catalog -> Catalog Search -> Search Engine I try to use Elasticsearch 7


1

It appears there was an issue with invalid form key errors when add to cart was clicked before the page was fully loaded. The change ensures that the add to cart button is enabled only when the page is fully loaded and catalog-add-to-cart.js has been processed. The commit from August 2020 can be seen here https://github.com/magento/magento2/commit/...


0

Go to this file path vendor/magento/module-catalog/view/frontend/templates/product/list.phtml Click ctrl+F and search for action tocart primary <button type="submit" title="<?= $escaper->escapeHtmlAttr(__('Add to Cart')) ?>"class="action tocart primary"> <span><?= $escaper->escapeHtml(__('Add to Cart'...


Top 50 recent answers are included