Questions tagged [event-observer]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
68 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
64 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 $...
0
votes
0answers
16 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 ...
1
vote
2answers
86 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
51 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
10 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
32 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
46 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
9 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
66 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
37 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
103 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
127 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
64 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
71 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
182 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
35 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 ...
0
votes
0answers
31 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
32 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
49 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 ...
0
votes
1answer
47 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
51 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
144 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
128 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
32 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 ...
1
vote
2answers
90 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
211 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
35 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
20 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
85 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
59 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
43 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
2answers
41 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
51 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
114 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
58 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
135 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
62 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
29 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
25 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
69 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
40 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="...
0
votes
2answers
172 views

Item not deleting from quote in Magento2

I have used observer to delete the quote item. Used this event controller_action_predispatch_checkout_index_index This is the code of my etc/events.xml. <event name="...
0
votes
1answer
34 views

Magento Observer to block spam orders not working

I'm facing some issues with orders placed by bots. I noticed that all orders are made by a specific phone number and also by a specific street. So I looked for a way to block orders that are made ...
0
votes
0answers
143 views

Newsletter subscribe/unsubscribe email notification event observer

I am writing my own admin email notifications module. So far it has New Order and Low Stock observers set up and working just fine. I want to add the Newsletter subscribe/unsubscribe observer to it ...
0
votes
2answers
193 views

Get product custom attribute in observer that listens to x specific event

Anyone know how to get product custom attribute in observer? In my case event is controller_action_predispatch_checkout_cart_add. My current code is giving me: Uncaught Error: Call to a member ...
0
votes
1answer
59 views

Creating event and observer for an action at backend of Magento 2 [duplicate]

How to create an custom event and observer for that event at backend in Magento2. For example I want to create an event that whenever an admin deletes a customer profile a separate log file is ...
0
votes
1answer
35 views

What are the three different kinds of Plugins available and their difference with observer in magento2?

I want to know the different kinds of plugins, their utilities and difference along with their difference with observer in magento2.
2
votes
1answer
60 views

Magento 2 “Area code not set” warning in Observer from module

I get "Area code not set error" when my observer executes. What can I do? Code: <?php namespace MyCompany\MyModule\Observer; use Magento\Framework\Event\ObserverInterface; use \Magento\...