Use of Event catalog_category_change_products Magento 2.

Magento 2 uses catalog_category_change_products events to Checks if a category has changed products.

If you change an existing product from the category or adding new products to the category at that time, Magento use event for change products.

Declaration of the event from the vendor/magento/module-catalog/Model/ResourceModel/Category.php with a method, _saveCategoryProducts() that add logic for the Save category products relation. Continue reading “Use of Event catalog_category_change_products Magento 2.”

How to perform event action for Catalog Product after delete completed?

You can perform event action to successfully Product deleted in Magento 2 by the catalog event name catalog_product_delete_after_done. This is the perfect event for product delete observer.

If Magento is sync with a third party ERP system and wants to sync product data between two platforms, if product deleted in Magento and want to delete a product from the ERP, You can perform this action using Magento native Event catalog_product_delete_after_done. Continue reading “How to perform event action for Catalog Product after delete completed?”

How to Set Product final price using catalog_product_get_final_price Event in Magento 2.

You can modify the final price value by define events in your XML file with Magento 2.

catalog_product_get_final_price the event defined under the Magento\Catalog\Model\Product\Type\Price class.

You can also interested to check,  A Complete List of all events in Magento 2.
Continue reading “How to Set Product final price using catalog_product_get_final_price Event in Magento 2.”