The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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
57 views

Creating custom event observer for after sale

I'm attempting to create a custom observer that will trigger after a successful purchase has been made. I assume that sales_order_save_after is the correct event to use. What the Observer will do is ...
0
votes
1answer
101 views

Override SenderBuilder class to add Bcc when sending invoice

I didn't found an event when invoice email is sent, so i tried to override Magento\Sales\Model\Order\Email\SenderBuilder class, the override is working but getting the customer attribute invoice_email ...
0
votes
0answers
18 views

Magento2 - add sales order custom attribute in checkout with validation in shipping section

I want to add 3-4 custom sales order attribute in checkout page in shipping section with shipping validation, attributes like text,checkbox.
2
votes
4answers
173 views

Magento 2.3.0 How to get request parameters in event observer?

I would like to get a request parameter in the observer file. Below is the observer code. etc/frontend/di.xml <event name="review_save_before"> <observer name="set_customer_data" ...
1
vote
0answers
56 views

Magento 2 - Recently viewed product not working with FPC

Magento default functionality of recently viewed product uses the following event to save viewed history catalog_controller_product_view And it stores in following tables ...
2
votes
0answers
17 views

Using Split Orders Extension but order confirmation mail is shooting for first order only instead of all

I'm using "order split" extension based on seller,means if there are 6 items in the cart having 3 different seller(have 2 item for each seller) then three orders(let's says order id as 500,501,502) ...
0
votes
0answers
15 views

Add additionnal receiver when sending invoice mail event

I'm new to Magento, i'd like to know how to override Magento function that send invoice email, by adding an additional receiver (other than the customer), or send another mail when an invoice is sent ...
2
votes
1answer
316 views

Magento 2 - Why does `sales_order_save_commit_after` not fire when user is not logged in?

I am using an observer to handle some logic when a new order is created or updated. The observer listen to sales_order_save_commit_after event, but I noticed that when the user is not logged in this ...
1
vote
3answers
116 views

how to get quote id before placing order M2

I am struggling to find which event I should use to get the quote id? I want to save some data in db, want to save customer session id and quote id before placing an order? Can someone suggest which ...
0
votes
1answer
33 views

Magento 2 - Order Item changes

I want to inform customers with email all the details of their orders and I want to be able to show the difference. For example: Those items shipped: ... Those items cancelled: ... Those items ... ...
0
votes
1answer
75 views

How to get Creditmemo ID from sales_order_creditmemo_refund?

If I observe sales_order_creditmemo_refund event, there’s no entity_id or increment_id data in the passed object. I presume those are added before the sales_order_creditmemo_safe_after event. However,...
1
vote
2answers
133 views

Get order increment id in observer

I have created a module to save order details to a custom mysql table after checkout completion. All works fine but the order id saves in the format "210"(order_id) instead of "1000000210"(...
3
votes
1answer
58 views

How to call dispatch events specific for Mobile?

How to call dispatch event for REST API's only in mobile devices.
0
votes
1answer
94 views

Why preference not working in Magento 2 observer (Custom module)

etc/di.xml <preference for="Custom\Pricerule\Observer\Frontend\Catalog\Catalog\ProductGetFinalPrice" type="Lof\RequestForQuote\Observer\ProductGetFinalPrice2" /> observer/...
0
votes
1answer
49 views

checkout_onepage_controller_success_action event save entry in custom table on order success in magento2

i have created event and observer checkout_onepage_controller_success_action now I want to save data in the custom table of order success when order is placed event.xml <?xml version="1.0"?> &...
0
votes
0answers
83 views

How to add massaction in product grid in magento 1

What is the easiest way to add add mass action to product grid using only observer and controller(no block). I would like to see a simple example because it is the first time I create it.
1
vote
1answer
122 views

How to redirect customer on custom page after registration in Magento 2

Here is my code customerregistersuceessobserver.php <?php namespace Webkul\Marketplace\Observer\Rewrite; use Webkul\Marketplace\Observer\CustomerRegisterSuccessObserver; use Magento\...
1
vote
0answers
34 views

Check stock at cart validation

I need to call a webservice to ckeck the stock of products in my cart. I added this observer: MyModule/etc/events.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/...
1
vote
3answers
174 views

Magento2: how to debug in sales_order_place_after event

registration.php <?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, 'Hafiz_Sms', __DIR__ ); etc/events....
1
vote
1answer
186 views

Magento 2: I need to run observer function through Cron job

I want to run an observer function through a Cron job. Can anyone share the simple observer function.? Here is my code <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
1
vote
1answer
95 views

pass array from php file to phtml?

i use observer on order place . sales_model_service_quote_submit_before when order is place i get order items and each item has a seller id . i get email from seller ids. and now send mail to those ...
0
votes
1answer
113 views

Set cookie in Observer Not working when full page Cache is enabled

I have to set category id in cookie when customer go to Category page and update cookie with category id when visit again using seperate module. I have created Observer and set cookie there but not ...
0
votes
1answer
90 views

How to get the custom attribute of products from the cart?

There is an attribute in the product AllowSameDayDelivery how can I get it out of the product? I got the products ids from the cart, But how do I get the attribute now? <?php namespace Ronis\...
0
votes
1answer
39 views

Does not work events magento 2

Events do not work when I go to the product page. events.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:...
0
votes
0answers
49 views

how to get the custom page event happened data to observer in magento 2?

I have custom module observer in Magento 2 <event name="controller_action_postdispatch_mpquotesystem_sellerquote_quoteedit"> <observer name="...
0
votes
2answers
50 views

Magento 2: catalog_product_save_after only for new products?

Ive made an observer for the catalog_product_save_after event, but I want to only fire it when a new product is added to the catalog. I did the same for the sales_order_save_after event and just ...
2
votes
3answers
272 views

Get current product id in Observer controller_front_send_response_before

catalog_controller_product_view event cannot be used in conjunction with FPC cache since Magento will not raise it after the first visit. That's why I am using controller_front_send_response_before ...
1
vote
1answer
78 views

Event Observer for import with magmi

I created an event observer to report the creation of new magento products, but the observer doesn't work when the products are created by importing Magmi. My magento version is 1.9.3.9 This is the ...
0
votes
3answers
210 views

how i can override the observer of other modules in magento 2

how i can override observer of other module(custom module) to my another custom modules in magento 2 is it possible ??? Does anyone have an idea? ex : custom module 1: the observer for ...
2
votes
2answers
83 views

event observer for the creation of new products

I want to run the observer only when the product is created and not when it is updated. I found this discussion: product-creation-and-saving-existing-products and I followed Tim Ramsey's advice. So I ...
1
vote
2answers
58 views

Plugin wont set Stock level and status - Module wont fire on Product Load

Please advise on this I'm trying to update a stock level and status via a seperate API, and will code that when I get this working, however, I'm struggling to even set the Stock status and count to ...
0
votes
0answers
38 views

when i select custom shiping method my other shipping methods not working in magento 2

i have two shipping methods 1)Custom shipping 2)Free shipping when i select custom shipping it works fine when i choose free shipping showing error on checkout undefined index : ...
0
votes
2answers
53 views

undefined index in $cookie['test'] in Magento 2 checkout observer

The shipping method custom module's observer shows error checkoutobservershipping.php if ($_COOKIE['pickupStoreVal']) { $id = $_COOKIE['pickupStoreVal']; $...
0
votes
1answer
35 views

Observer doesn't work

I tried a few iterations and for whatever reason I can't add cookies or even execute any code from my observer, as it's not giving anything even if my observer has dies in it. I have my module visible ...
0
votes
1answer
114 views

Magento2 update cart on qty change event plugin created

My website i have updatecart on qty btn change event call so with ajax how to created a plugin for this.
3
votes
1answer
158 views

Magento 1.9 observer on only new product added ( no updated product )

I need an observer when a new product is added, I don't need one when a product already exists and it is updated. I found catalog_product_save_after and _before but this is triggered when a product is ...
0
votes
1answer
80 views

How to stop merging of non-loged-in cart items when customer logs-in?

I do not want to merge cart items if the user has items in cart and logs into the site. Let's go through the scenario: User logs in and adds one item to cart and logs out from a site. Now as a ...
2
votes
1answer
235 views

Magento2 send Order information to Google Analytics when order from admin

Though Magento 2 has the inbuilt implementation to send the transaction/order details placed on webstore or frontend to Google Analytics, it lacks the same ability when orders are being placed from ...
0
votes
1answer
77 views

Buys X get cheapest as Y from same category magento 2

As per the answer from here I have created an event for salesrule_validator_process and the code is below. class CustomCartPriceRules implements ObserverInterface { public function __construct() {...
1
vote
1answer
30 views

Save custom value in sales_shipment_item

i have custom attribute ("current_seller_id") in sales_shipment_item table and want to save custom value in it when click on submit invoice Can any one tell me which event or use plugin method for ...
1
vote
0answers
30 views

How to refresh minicart section from observer?

I am moving cart items to wishlist when store is switched using below code: etc/frontnend/events.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
2
votes
1answer
26 views

Magento 2: Use Magento\Sales\Model\Order after order has been placed

I'm currently working on a custom module. I need to get order data of the order that has just been placed. The problem is, that I cannot get the data with Magento\Sales\Model\Order. It looks like the ...
1
vote
1answer
59 views

Update custom data for customer

I'm trying to Create new customer attribute "last_login_at" to store customer last login date time. My requirement is to update "last_login_at" data for the customer after the customer logged in. I ...
3
votes
2answers
119 views

How to check observer called from search page?

I am accessing observer (controller_action_layout_render_before) through this: app/code/Vendor/Module/etc/events.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/...
0
votes
1answer
73 views

Magento2 Event after Default Billing address change, How to send email if Billing address change?

I want to send an email to admin if the default billing address selection is changed or the values are changed by the customer. How can I achieve this?
0
votes
1answer
72 views

Observer or plugin use before the invoice creation

I have create custom attribute("current_seller_id") in sales_invoice_item and now want to save some value in this column how can i do this. Actually i already save the value in sale_order_item table ...
2
votes
1answer
87 views

How to get recently viewed product collection in observer Magento 2

I want to fetch a recently viewed products collection in the observer and by using that collection I want to add my custom product in that collection. Following Things That I Want To Achieve. On ...
6
votes
1answer
145 views

Save and display ui_component's custom field

I've added custom text box to source form using below code. <field name="delivery_time" formElement="input" sortOrder="70"> <settings> <dataType>text</...
1
vote
0answers
132 views

Magento 2 - Event after customer edit Account Information

I need to add some custom logic in my extension after Editing Account Information, It should not trigger at Change Password or Edit Address. Will customer_account_edited work. $this->...
1
vote
0answers
329 views

Magento 2 Send Admin Customer Registration Email

I'm trying to set up an observer that sends an email to the admin when a user registers on the website. I am following a tutorial but have hit a dead end. The observer is working correctly however I ...