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
141 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
115 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
40 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
53 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
63 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
315 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
85 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
260 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
157 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
70 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
84 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
81 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
150 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
159 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
122 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
301 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
83 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
31 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
27 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
66 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
151 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
84 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
99 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
124 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
150 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
148 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
441 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 ...
1
vote
0answers
10 views

Magento 2 : Getting issue during added non-visible product to cart through observer?

For this, I use below event observer <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:...
0
votes
1answer
27 views

Magento2 : IncrementId value not resulting in an order

I want to load the data of an order with the incremental id after placing an order. I am getting the incremental id in the data array after placing an order, but cant load any orders with it. My ...
0
votes
1answer
266 views

How to set a custom price of a product when adding to cart using an observer in Magento 2?

I want to set a custom price of the product when adding to cart using an observer. For that, I added this code but it's not working app\code\Webkul\Hello\Observer\CustomPrice.php <?php /** ...
0
votes
1answer
47 views

Button add to cart stays on adding… after i setParam('product', false)

I have a checkout_cart_product_add_after event that calls to a observer file in which i want to check a condition. If that condition is false i block the product from adding to the cart and want to ...
2
votes
2answers
31 views

Issue with an observer

I created an observer to update the product, but it is not entering it. config.xml: <cataloginventory_stock_item_save_after> <observers> <gestaobox_api> &...
1
vote
3answers
111 views

Get productinfo from Observer controller_action_predispatch_checkout_cart_add

In Magento 2: I have created the event observer: <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:...
2
votes
0answers
18 views

Set product attribute “comment” from backend

No time for coding actually, so I just want to ask if maybe someone already has a working solution (w/o rewrites) :) I just want to add a text input field to "edit product attribute" page, that show "...
1
vote
1answer
275 views

Magento 2 - Get Invoice data using observer

I am trying to know if create shipment option is selected from admin while creating invoice from admin by creating an observer. I have tried sales_order_invoice_register ...
3
votes
1answer
156 views

Any Observer or plugin event for specific module disable?

I want to perform some action when my custom module gets disable. Is there any observer event or plugin event that being fired when i disable my module? Any help would be appreciated. Thank you,
2
votes
1answer
90 views

Magento 2: Checkout afterplace order plugin not working

Im creating a Magento 2 checkout plugin, I want to fetch the orderdata and send it to a third party for order handling. I have made a plugin for the Magento\Sales\Api\OrderManagementInterface class, ...
1
vote
2answers
546 views

Magento 2 checkout observer debugging

I'm trying to create a Module that gets the order data when an order is placed and sends it to a third party using FTP. I've created an Observer that gets called by the sales_order_place_after event. ...
0
votes
0answers
30 views

Magento 2 Observe Button in another module

I was wondering if it were possible to execute some code from within another module when a button is clicked from within the current module? Is there some way of attaching an observed event on to the ...
1
vote
1answer
27 views

Catalog page loads at the middle of the screen when using pagination - M 2.1.15

When I go to page 2 or 3 it takes me to the lower middle half of the page instead of the top of the next page. Is there a way to make it go to the top of the next page instead?
6
votes
1answer
436 views

Automatically send invoice email after order has been paid in Magento 2.2.3

I am trying to trigger the customer invoice mail after an order has been paid and the invoice has been created. The payment gateways are PayPal Plus (iways) and Amazon Pay. If I understood correctly, ...
2
votes
1answer
157 views

Observer for import products

I want to create an observer to execute when the import product is executing, i need persist product informations in another table when the export action is in process, i try the following: ...
1
vote
1answer
135 views

Disable sort/filter for existing grid column

Is it possible to disable filterable/sortable for an existing grid column via observer or layout update?
2
votes
2answers
120 views

Magento 2 - disable sale for product by plugin or event

The product has attribute "is_special_action". I need to disbale product for sale if this attribute equals 1. I suspect we can use CustomModule\Plugin\Catalog\Model\Product.php class, add this ...
3
votes
1answer
126 views

Sign up (guest checkout) issue in Magento 2

I have added customer_register_succes event for guest customer account creation during guest checkout. After the successful order when the user sign up by my event and observers call in which I load ...
5
votes
1answer
56 views

How to assign cart data in order Magento 2?

I am successfully save custom data in cart using checkout_cart_product_add_after event in "quote_item_option" table Now i want to save this data in order and display in order section in admin panel.
3
votes
0answers
24 views

Background or concurrent taks in Controllers

I am currently programming an extension for Magento 2. I am developing an observer that is triggered when you make an action inside a controller in the admin section. What I do is to fetch all ...
1
vote
1answer
98 views

Event for before invoice creation magento 2

Do we have any event for invoice before create? When we click on invoice and about to submit the form , do we have any event there? Want to do some modification before creating invoice.