3

You have to place a events.xml in the webapi_rest area: app/[Vendor]/[Module]/etc/webapi_rest/events.xml By placing the events.xml in the webapi_restdirectory the observer only listens to events dispatched in that area. You can read about the areas and events in the devdocs.


3

You can declare your observer at the following location to call it via the REST API only. app/code/Vendor/Module/etc/webapi_rest/events.xml


2

Observer doesn't provide sort order. So, it may be create issue when create same events in multiple events. So, I would like to suggest you to create plugin for that and avoid same events use in multiple module. Plugin provide you to set sort order if same function's plugin create in multiple action. You can use plugin in method type will be public. ...


2

You can use plugin for that instead of event and apply your code logic for redirection : app/code/RH/CustomPlugin/etc/frontend/di.xml <?xml version="1.0"?> <!-- /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...


2

You could also go for the observer route, you can check all the events that are triggered here (for Magento 2.3). In this case I would try the event adminhtml_customer_save_after event (triggered here \Magento\Customer\Controller\Adminhtml\Index\Save::execute). The event contains data about the request and the customer, so it will be enough to work with. ...


2

you need to follor the below blog to generate system log else you need to create the system.log file in var/log/folder and your log is print in that file


1

You can use "customer_delete_after" event in Magento 2.3. <event name="customer_delete_after"> <observer name="ddg_remove_contact" instance="Dotdigitalgroup\Email\Observer\Customer\RemoveContact"/> </event> This event is used in Magento's dotmailer module in the vendor. Below is the link for the event list in Magento 2. https://...


1

You can listen to the sales_quote_save_after event, then use the quote to get the shipping rates. The following code can be used to get the list of shipping rates. $quote->getShippingAddress()->getGroupedAllShippingRates();


1

In your Vendor\ModuleName\etc\frontend\events.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="checkout_onepage_controller_success_action"> <observer name="custom_frontend_observer" instance="...


1

You need to create even observer as below <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="customer_login"> <observer name="customer_login_observer" instance="<Your_packagename>\<...


1

I don't know wether your conditions work, I leave that up to you. The problem with the error comes - I assume - because the addProduct() is not inside a try/catch block. The default Magento Controller looks like this: \Mage_Checkout_CartController::addAction public function addAction() { /* ... */ try { /* ... */ $cart->...


1

catalog_product_save_before use this event but dont call save function


1

It's not update because you are using catalog_product_save_after event. So, on product save again event will be call. So, You can use controller_action_catalog_product_save_entity_after or catalog_product_save_before event and You can update SKU like this below code : <?php namespace VendorName\ModuleName\Observer; use Magento\Framework\Event\...


1

Yes, We could use multiple modules : <event name="catalog_product_save_after"> <observer name="adams_mage_add_custom_option" instance="CompanyName\ModuleName\Observer\AddCustomOption" /> </event> for another module same event : <event name="catalog_product_save_after"> <observer name="inventory" instance="...


1

Yes you could use them in any number of Observers. Events are dispatched in broadcasting manner, so any number of Observers can be listening to the same event. Either in same module or different module.


1

Yes you can use it multiple times in your project. in events.xml <event name="catalog_product_save_after"> <observer name="my_custom_product_save_observer" instance="Vendor\module\Observer\Productsaveafter" /> </event> And your observer code: <?php namespace Vendor\Module\Observer; use Magento\Framework\Event\...


1

In config.xml: <class>Kolupadi_Restrict_Model_Observer</class> should be <class>Gta_KolupadiRestrict_Model_Observer</class> Change your app/etc/modules/Gta_KolupadiRestrict.xml <?xml version="1.0" encoding="UTF-8"?> <config> <modules> <Gta_KolupadiRestrict> <active>true</...


1

Get category and subcategory: <?php $_helper = Mage::helper('catalog/category'); $_categories = $_helper->getStoreCategories(); if (count($_categories) > 0){ foreach($_categories as $_category){ $_category = Mage::getModel('catalog/category')->load($_category->getId()); $_subcategories = $_category->...


1

You can try Something like this $product = Mage::registry('current_product'); $prodID = $product->getId(); $_product = Mage::getModel('catalog/product')->load($prodID); $categoryIds = $_product->getCategoryIds(); if($categoryIds[0]==4){ // Do something }else{ return; }


1

Have you tried logging API rest calls and going from there. https://github.com/vladflonta/magento2-webapi-log But essentially it sounds like you are going to either have to introduce your own event in an override or modify something like the above to only catch shipstation calls.


1

There is a problem with this particular event Magento 2 origData null in customer_save_before You are going to have to use a different event or code a workaround.


1

$billingZipcode = $billingAddress->getPostCode(); Should be $billingZipcode = $billingAddress->getPostcode();


1

For me, sales_order_save_commit_after was the only event that worked well: If you need the event to be triggered in the admin area and also in the frontend, you can add the following code in etc/events.xml. If you need it for the order created from admin only, you need to add the following code in etc/adminhtml/events.xml Code: <?xml version="1.0"?> ...


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