Hot answers tagged

2

This plugin will work for simple and configurable products. You can throw an error or redirect e.g. to cart if product already exists in cart. di.xml <type name="Magento\Checkout\Model\Cart"> <plugin disabled="false" name="Vendor_Module_Plugin_Magento_Checkout_Cart_BeforeAddToCart" type="Vendor\Module\Plugin\...


1

The first thing i noticed in your code is that the block type is not core/messages for the 'global_messages' (reference is app/design/frontend/base/default/layout/page.xml where the 'global_messages' block is defined). However, if you check the app/code/core/Mage/Core/Block/Messages.php class, you will see that this block doesn't use a template file, it is ...


1

You can use plugin for that in you di.xml <type name="Magento\Checkout\Model\Cart"> <plugin name="prevent_add_to" type="vendor\Module\Plugin\Beforeaddtocart"/> </type> vendor\Module\Plugin\Beforeaddtocart.php <?php namespace vendor\Module\Plugin; class Beforeaddtocart{ public function ...


1

The cart summary text is set in vendor/magento/module-checkout/view/frontend/layout/checkout_cart_index.xml To change this text extend the layout with a custom module or theme and change the summary block text argument <referenceBlock name="checkout.cart.summary.title"> <arguments> <argument translate="true" ...


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