skip to Main Content

Update IsInStock attribute in observer by 'catalog_product_save_after' event in Magento2.3

I have tried this code in Magento 2.3.4 created events.xml in DaplShortdurabilityetcadminhtml 2.created Productsaveafter.php in DaplShortdurabilityObserver. <?php namespace DaplShortdurabilityObserver; use MagentoFrameworkEventObserverInterface; use MagentoCatalogModelResourceModelProductAction; use MagentoCatalogInventoryModelStockStockItemRepository; class Productsaveafter implements ObserverInterface { private $action; private $stockItemRepository; public function __construct( StockItemRepository $stockItemRepository, Action…

VIEW QUESTION

How to extend galley.phtml in Magento2?

I want to add custom code in gallery.phtml in the PDP section on my custom module. I tried this=> called default the block in catalog_product_view.xml <referenceBlock name="product.info.media.image"> <action method="setTemplate"> <argument name="template" xsi:type="string">Ajith_Mymodule::product/view/gallery.phtml</argument> </action> </referenceBlock> loaded gallery.phtml with and without default…

VIEW QUESTION
Back To Top
Search