2

Set Additional Option Using Observer We can use “sales_model_service_quote_submit_before” event to copy additional option from quote item. First of all we need to define it in events.xml. Write following code in events.xml file. <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:...


2

You can use and inject Magento\Customer\Model\Session in your observer class to get the logged in Customer Id. It doesn't matter whether the dispatched method has customer object, you can use this customer model session class to get the customer object. Your observer should be like this app/code/StackExchange/WishlistCustomer/Observer/WishlistAddItem....


1

At Vendor\Module\Observer\NewCustomer, observer you need to use $editedCustomerEmail = $observer->getEvent()->getCustomer()->getEmail(); instead of $editedCustomerEmail = $observer->getEvent()->getEmail(); at customer_register_success event's Observer, you can get Customer data using $observer->getEvent()->getCustomer(). At ...


1

customer_save_before is an event linked to the customer model. So it's not a good idea to redirect from the observer on that event since you won't know exactly where is triggered. You should just throw an instance of \Magento\Framework\Exception\LocalizedException in case your criteria does not match. For example public function execute(....) { if (...


1

The observer code you shared in https://justpaste.it/7l2ka contains a die() which will break execution due to Fatal error (unexpected 'die' (T_EXIT)) <?php class Gta_FindPaymentGateway_Model_Observer { public function paymenter($Observer) { $order = $Observer->getEvent(); Mage::log($order->getName(), null,'event.log',true); } die(); // !!!!!!!!!...


1

People report your code to work correctly on their installations, so the issue obviously is specific to your setup or magento project's code base. https://justpaste.it/7l2ka proves that your observer class isn't being parsed as php would fail with a syntax error doing so. For magento backend development I rely on magerun. It provides all kind of useful ...


1

I have created module same as yours, Please check the below code. app\code\local\Gta\FindPaymentGateway\etc\config.xml <?xml version="1.0"?> <config> <modules> <Gta_FindPaymentGateway> <version>1.0.0</version> </Gta_FindPaymentGateway> </modules> <global> <models> &...


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