Questions tagged [event-observer]

Event/observer is used to work dynamically with Magento without altering the core code.

Filter by
Sorted by
Tagged with
1
vote
1answer
40 views

Error message not displaying in Observer Magento2

I used below event, <event name="catalog_controller_product_view"> <observer name="custom_product_view_layout" instance="Vendor\Module\Observer\CheckProduct" /> </event> Then ...
0
votes
2answers
178 views

Magento 2 : Event when customer in backend is created and updated

I want to know how to solve this problem: I need to trigger an observer when a customer is created and one different when customer is updated. I was using customer_save_before event which works ...
0
votes
1answer
68 views

Observer not triggered for customer_register_success event

I've read through countless posts with similar issues and have made sure I didn't have the same errors. I'm trying to use the customer_register_success event to trigger an observer that will fetch an ...
0
votes
0answers
44 views

Event for apply discount coupon Magento 2

I want to add custom validation for Discount coupon that it can be used only on first order of any customer. For this i want to create an observer for an event which will trigger when customer ...
0
votes
1answer
292 views

Magento 2 how to get customer data in Observer in customer_account_edited event?

I'm trying to get customer Id, first name, last name , email and Address info after customer_account_edited event is triggered, but I'm getting error 500 and the error is Uncaught Error: Call to a ...
1
vote
1answer
29 views

Magento 2: Get names of all people who ordered the product

Our client would like to have names of all people who ordered a product included into the Out of Stock notification email. I seem to have issue with getting such info ... Code I have to get the ...
2
votes
4answers
326 views

Magento 1.9 : What event used before order placed and get shipping information for the order [closed]

For my condition how to get the shipping methods before order placed My Observer : https://gist.github.com/ZusZus/66da0a7aaeb0db53eff38d8bb89ae941
0
votes
1answer
169 views

Magento 1.9: get data from text area in observer using event?

I need get data from text area in which customer write comment, than that comment I need add to order using sales_order_place_before event and save order to sales_flat_order. Customer comment must add ...
0
votes
2answers
103 views

Magento 1.9: Print variable value in Mage::Log

My observer : public function checkproductinorder($Observer) { $order = $Observer->getEvent()->getOrder(); $items = $order->getAllItems(); foreach ($items as $...
1
vote
0answers
25 views

magento 2 event for out of stock

I would like to know when a product goes out of stock by user purchase. I think there should be an event for this. I am not able to find it though. Also, in general, has Magento 2 published the ...
2
votes
2answers
439 views

Magento 1.9.X: Add customer comment to order using observer

How can I add customer comment from checkout page using observer? Customer comment is introduced from the block with a text area. When I create new order I need to add a comment to this order using ...
0
votes
1answer
53 views

Update Product prices after adding to cart

I am trying to update product prices after adding to cart but the change on prices don't apply on it. I have created an event on checkout_cart_product_add_after while on observer I have written code ...
0
votes
0answers
15 views

Magento 2: Get Raw POST data whenever /shipping-information API is hit

I am using a headless magento 2 for my store, and am having some data consistency problems with shipping addresses. To troubleshoot this, I was thinking about saving the POST body whenever these API ...
0
votes
1answer
50 views

Magento 1.9 : How can i filter specific state inside foreach with Observer

How can I add if the condition for my for each loop, my_observer : <?php class Gta_GetOrderDetails_Model_Observer { public function getdetailsafterorder($Observer) { ...
0
votes
0answers
79 views

Magento 2 : Stock Inventory Save After Observer - Issue

This observer triggered only when Quantity is out of stock or when we save the Quantity. Is there any other Observer event in Magento when the Quantity get Change while creating an order from the ...
0
votes
0answers
11 views

I need to change customer group when user logs in via specific link

I need to link already registered user to the customer group. I'm trying to solve it using event and observer. User will receive a link and logging in using the present link, the customer will be ...
0
votes
1answer
161 views

Magento2 : Product not saving set custom attribute using Observer

I want to set Discount on my product after Save product so I'm using catalog_product_save_after then I am creating an attribute 'discount' and set the calculated value, but when i save the collection ...
0
votes
1answer
84 views

what is the use of _merge_before and _merge_after event in Magento 2

I want to know the difference between following Magento 2 events 1)sales_quote_add_item 2)_merge_before 3) _merge_after and how I can use the event in event.xml sales_quote_add_item and ...
0
votes
1answer
245 views

Magento 1.9 - How to Override/Rewrite Third party Module?

I am using this extension for Extra Fees, I did some override/rewritein this file in magento (app/code/local/Voronoy/ExtraFee/Model/Quote/Address/Total/Fee/Rule.php). FYI -> The override/rewrite ...
0
votes
2answers
322 views

What event should I use for Customer delete observer in Magento 2.3?

I'm very new to Magento 2.3, so I can't find a list of all the events that are related to user accounts. I need to create observers for user deleted, user updated (any information in account) and user ...
0
votes
3answers
101 views

Magento 1.9 Obsever testing failed - Mage::log not generated

My observer : <?xml version="1.0"?> <config> <modules> <Gta_ExtraFeesRemove> <codePool>local</codePool> <active>true</...
0
votes
1answer
89 views

How to get the name of the triggered event? [closed]

How to self check what event i am using, my event : <checkout_cart_product_add_after> how to print, i tried : $event = $observer->getEvent()->getName(); Mage::log($event, null, '...
3
votes
2answers
296 views

How do I create an events observer that only calls when the REST API dispatches events?

I just want to call an event observer when the event is dispatched via the REST API. Like if an order is placed from a mobile application, only then the sales_order_save_afterObserver should be called....
0
votes
0answers
47 views

Magento 2 : Change product price while moving to cart event and observer

I have created a custom module but moving to cart I want to add a custom price which event i can use to change the price how to change product price while moving to cart event and observer Magento ...
0
votes
0answers
32 views

How to Restrict product add-to-cart if cart has specified category of products?

If my cart consists category id = 4 products, no other products eligible to add-to-cart, how to restrict by using anything, i tried using observer it not work.Please any one help.
0
votes
1answer
51 views

How can i call editPost controller after an observer(checkout_onepage_controller_success_action) Magento 2

I have to save the account edit with customer default shipping address details. After the successful order placement. I have created the observer but not sure how to call editPost of the customer ...
0
votes
1answer
134 views

Magento 2 : Separate home page for logged in and guest user [closed]

I want to show different home page for logged in user, Which event/plugin I can use for this ? Whenever logged in customer clicks on homepage he should be redirected to different url Logged-in user : ...
0
votes
1answer
64 views

Observer throw Exception message without loading logic

Observer : public function cartevent(Varien_Event_Observer $observer) { // Load product $product = $observer->getProduct(); $prodID = $product->getId(); $...
0
votes
2answers
118 views

Magento 2 :- how to get email address in sales_quote_address_collect_totals_before events

How to get email address in sales_quote_address_collect_totals_before events guest user email address. <?php namespace xxxxxx\xxxx\Observer; use Magento\Framework\Event\ObserverInterface; ...
1
vote
1answer
422 views

Magento 2 How to notify user when it's customer group has changed?

I want to find a solution for sending an email to the customer when the administrator in backend changes its customer group. I have 3 customer groups, each one has different discounts in the store, so ...
0
votes
2answers
192 views

Observer Mage::throwException error - status 503 error

I just want to restrict some of the category of products to purchase with other category products, Workout : If customer click add to cart using observer compare current add-to-cart product ...
0
votes
1answer
88 views

Event for Add to Wishlist button in Magento2

I want to redirect User to Observer on Add to Wishlist Click i want this for guest users Example if customer is not logged in then it must redirect user same page So far i have tried Following ...
0
votes
2answers
364 views

Magento 2 How to update SKU after saving product from admin panel?

I want to update product sku after save product. I had used this event :- catalog_product_save_after In Observer, public function execute(\Magento\Framework\Event\Observer $observer) { ...
3
votes
4answers
643 views

Magento 2 Is it possible to use same event in multiple Modules?

I wanted to use catalog_product_save_after event in 2 different modules, Is it possible to use it? Please help me!
0
votes
0answers
46 views

How to load category (selected id's) in observer

In my observer, i need to load my selected category id's & selected website, workout: $category_products = Mage::getModel('catalog/category') ->addAttributeToFilter('category_id', array(...
0
votes
0answers
24 views

how to get guest email address in CollectTotalsObserver page in magento 2

how to get a guest email address in CollectTotalsObserver page in Magento 2. public function execute(\Magento\Framework\Event\Observer $observer) { /** @var \Magento\Quote\Api\Data\...
0
votes
2answers
96 views

Restrict products to purchase using Observer not trigger

Condition: I have restricted category of products [category id = 680, 894, 895], this category of products should be purchase alone, not mixed with other products. Workout: Case 1: If cart had other ...
0
votes
2answers
120 views

How to get Categories of products In Observer?

I need to add a condition for my category in the observer, how can I call category?
0
votes
1answer
45 views

Add to cart before Magento 1 - Cancel adding

I am creating an observer to cancel the addition to the cart with add_to_cart_before. Here is my config.xml Module_Stockespagne_Model ...
0
votes
3answers
69 views

Event when order created from backend

I've used sales_order_place_after to get order id after order placed from backend but it doesnt return order id. Not sure what's missing here. Here's my observer public function execute(\Magento\...
0
votes
2answers
183 views

Magento 2.3: How to get tracking info from an order in observer

We use ShipStation to send tracking information to Magento and I'm trying to retrieve the order shipping / tracking information once this is saved to the order. If I use ...
1
vote
0answers
192 views

How to extend store credit functionality in Magento 2 Enterprise Edition

I want to add amount as store credit by: -> API -> Using Payment Method By default store credit is added when we redeem gift card. But my requirement is to add store credit directly by customer ...
0
votes
0answers
56 views

magento 1.9 | what event-observer used when product was sold

I can't figure out which one i need to use events, when product was sold (when was the payment)? Please tell me what I need to use.
0
votes
1answer
269 views

Magento 2 get customer old and new data on save customer button in admin backend

I am working on Admin Actions Log Extension. For the reference i am using link below https://amasty.com/admin-actions-log-for-magento-2.html I want to get old and new data of customer while we save ...
0
votes
2answers
325 views

Magento 2 how to get Postcode from billing address in observer?

I cannot get the postcode from Users's billing Address,this is my code, everything works fine except for the postcode, which i'm not able to pull. $objectManager = \Magento\Framework\App\...
1
vote
2answers
187 views

How to get customer id , customer firstname with customer_account_edited event ? Magento2

event.xml <?xml version="1.0" encoding="UTF-8"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">...
0
votes
0answers
33 views

How to create an event-observer that will help print a log when admin modifies some customer details?

I want to design an event and an observer that will print a separate log containing the details of the fields that was modified by the admin in admin panel (under all Customers -> edit). How can I ...
3
votes
1answer
57 views

Magento 2 - Event Observer for user has downloaded downloadable product

I want to fire an action when a user has downloaded a downloadable product (i.e. they have clicked the link for the download). I don't know what event I should be observing to do this. I tried to ...
2
votes
1answer
112 views

Magento 2 Looking for configuration saved event

I'm trying to write something that automatically clears cache on magento, when user hits Save, on any pages under Backend / Stores / Configuration. I'm only looking for the proper event to hook into ...
0
votes
1answer
64 views

Error when observer is executed after order is placed

I created a module in order to save order data to a custom table: <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="...

1 2 3
4
5
39