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
2 answers
30 views

sales_order_save_before etc/frontend/events.xml not working properly

I've used the sales_order_save_before event scope is etc/events.xml - This is working fine but, etc/frontend/events.xml not working properly. sales_order_save_before event not support frontend scope?
user avatar
0 votes
1 answer
19 views

Order Updated At Date same as Created At

I am using the after plugin for the Place method following this link https://www.rakeshjesadiya.com/create-plugin-after-place-order-action-checkout-magento-2/ But I get the order updated at the date ...
user avatar
0 votes
1 answer
11 views

Shipment comment add event observer mangento 2

I want to send sms on shipment comment add. is their any observer for knowing comment has been added to the shipment.
user avatar
1 vote
2 answers
26 views

Observer that runs when an order is attempted to be created in the Admin

I need to create an observer or plugin or something else that will run when an order is attempted to be created through the admin. I added a custom attribute for customers (offline/online). If the ...
user avatar
  • 13
0 votes
1 answer
18 views

Insert content in product page

I need to insert (via my payment module) html element (div) somewhere (for example under Add to cart button) at product page view. Should I use event/observer, or maybe there is something other? ...
user avatar
  • 1
0 votes
2 answers
38 views

exclude some other product in the cart from receiving discount

How to get product value ( product price) if attribute "logitech" is set to yes [attribute is Boolean]. I'm new here, still learning magneto. below code, calculate all items in the cart but ...
user avatar
0 votes
0 answers
13 views

How to get Tier Price Observer

I am new in Magento. I try to get Special/Tiersprice. I have this code $item = $observer->getEvent()->getData('quote_item'); $item = ($item->getParentItem() ? $item->...
user avatar
0 votes
2 answers
28 views

Magento 2 Module Events

I'm new to magento module development and trying to write my own little module. Unfortunately, I'm having trouble understanding how to connect events to a REST request. What I want to achieve: ...
user avatar
  • 1
0 votes
1 answer
30 views

How can I intercept a sale order created from within the admin panel in Magento 2?

I need to write data to an extension attribute after the order is created from within the admin panel. The extension attribute is the admin user's first and last name. How do I intercept this the ...
user avatar
0 votes
1 answer
17 views

How to intercept customer order in Magento 2?

When an order is submitted, I need to write data to extension attributes. I need to either create an event observer or plugin. How do I do this the right way?
user avatar
0 votes
1 answer
33 views

Magento 2: How can I add new field and save data to newsletter database table?

How can I save data in a new field in newsletter table of database? This is how I created my module based on other answers, but no one of aproaches worked. The fields of column c_firstname is always ...
user avatar
  • 1
0 votes
1 answer
25 views

Reset billing address to default address

I'm trying to (re)set the billing address to the customers default billing address after receiving an order (this is for B2B clients which are not allowed to change their billing address). To do this, ...
user avatar
0 votes
2 answers
29 views

Magento 2.4: Which event triggers when the category page is loaded in magento2?

I want to know which event is triggered when a category page is loaded from the megamenu? I want to load a custom collection of data based on a particular category.
user avatar
0 votes
1 answer
26 views

Magento2: url redirection in controller_action_predispatch observer with setting post parameters

I am working on cms page restriction for specific customer group.I am using controller_action_predispatch event observer to check whether the current page is set for restriction and the current ...
user avatar
0 votes
1 answer
40 views

Magento 2.4.2: The following modules are outdated: Perfectmakeupmirrors_PmmHead schema: current version - none, required version - 0.0.1

I just created a custom module to add a metatag in a category page of our Magento site by making use of event and observer. When reloading the category page, below is the error I see. I re-ran the ...
user avatar
0 votes
2 answers
43 views

Magento 2.4.2: observer class not getting invoked on event layout_load_before

My objective is to set NO INDEX, NO FOLLOW to a specific category page in an observer class. Below is my event.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/...
user avatar
0 votes
1 answer
42 views

Magento 2.4.2: How to find out if it is category page in the observer class?

My objective is to set a specific category to NO INDEX, NO FOLLOW in an observer class. Below is my event.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/...
user avatar
0 votes
1 answer
32 views

Magento 2: Get extension attributes data before customer address is saved

We have created an extension attribute which we would be accepting via customer address REST API Endpoint: PUT customers/:customerId Request body: { "customer": { "email": &...
user avatar
  • 548
0 votes
1 answer
27 views

Setting a custom item subtotal when adding product to cart?

Magento 2.4 I already have my observer in place, but setting a custom subtotal for my item does not work. I am listening to the checkout_cart_product_add_after event. This is my observer code: $item = ...
user avatar
0 votes
1 answer
35 views

Magento 2 passing parameter from observer to itself

I made an observer for the catalog_product_save_after event. I need to do some changes to the "brother" products. To do this, I get the parent product id and then all his childens. For each ...
user avatar
0 votes
0 answers
13 views

Magento Events call multipele time controller_action_postdispatch_customer_account_confirm

After clicking on the email confirmation email button I have created the observer of an event. if i will click email confirm link then call my below events ...
user avatar
0 votes
3 answers
130 views

Magento2.4 - stock quantity deducted twice in observer

I'm using Magento 2.4.3-p1 and I'm trying to decrease stock quantity with custom observer while placing an order, but salable quantity is decreasing twice, my events and observer file are this: etc/...
user avatar
0 votes
2 answers
54 views

When i disable an observer found this type of error "This observer does not exist to be disabled."

Does any one have any idea about this type of issue?
user avatar
  • 15
1 vote
1 answer
17 views

How can i perform event and observer in Magento 1.9?

I need urgent solution. I'm newbie Magento Learner. How can I complete this task. Before Product save -> Build Event -> print die in Observer.
user avatar
0 votes
0 answers
37 views

Magento 2 change product attributes before saving

I have used the catalog_product_save_before event like below. <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
user avatar
  • 828
0 votes
0 answers
50 views

Programmatically update Stock Status Magento 2

I am trying to update Stock Status when the quantity is updated. Either from admin or web API (rest). app/code/Namespace/Module/etc/events.xml <?xml version="1.0" ?> <config xmlns:...
user avatar
  • 359
1 vote
1 answer
23 views

How to save posta code in custom zip_code field in sales_order table in magento2

I have created a custom zip_code field in the sales order table. I want to save the postal code in my custom zip_code field after place an order. please check the below code events.xml <?xml ...
user avatar
  • 13
0 votes
2 answers
74 views

Updating Product price using Observer

i am trying to update product price when product is added to cart It works and the price is updated but it does not allow me to add any other product to the cart except the product where condition ...
user avatar
  • 1,674
0 votes
1 answer
60 views

Gift Card Quote Item Prices are NULL in cart related events

I want to do some customization when a gift card is added to cart so I have created a module observer with event checkout_cart_product_add_after, I am getting the product id, product type on the quote ...
user avatar
  • 81
0 votes
1 answer
229 views

Understanding data bind at minicart in magento 2

I am using magento 2 in mini cart, I am trying to get the event during which product is being added and removed, a specific item not by cart shown is the item that exists in mini cart, I want that ...
user avatar
0 votes
0 answers
20 views

Catalog save observer

i want to write an observer that listens to any changes done in categories like i.e. adding/deleting a category, rearrange products in a category, rearrange categories, change visibility of a category....
user avatar
0 votes
1 answer
31 views

Get order data in different language?

I'm trying to fetch the order and/or the product data, but translated to a specific language/store view from an observer. This will send out an internal email so the order will be handled. Im calling ...
user avatar
0 votes
1 answer
31 views

How to get custom attribute value in after product collection load in Observer

I want to get multiple select type custom attribute values in product collection observer, I have tried with some events catalog_block_product_list_collection, ...
user avatar
0 votes
2 answers
45 views

Where to find shipment event in Magento2

I am trying to build a custom module that will trigger off a text message when Magento receives shipping information on orders. I know I can trigger off email, sms etc when an order is placed by ...
user avatar
  • 781
0 votes
1 answer
28 views

event sales_order_shipment_save_after is not working in magento 2.3.4

The event sales_order_shipment_save_after is not working in magento 2.3.4 after shipment submit. event.xml file SubmitShipmentAfter.php file addWriter($writer); $logger->info($result); } }
user avatar
0 votes
2 answers
25 views

Magento 2 Get In Cart Product Brand, Variant and Quantity

in Magento 2 I am trying to get below details of the product from the customer cart Name ID Price Brand Category Variant Quantity This process I added in observer during customer proceed to checkout ...
user avatar
0 votes
1 answer
26 views

Update IsInStock attribute in observer by 'catalog_product_save_after' event in Magento2.3

I have tried this code in Magento 2.3.4 1.created events.xml in Dapl\Shortdurability\etc\adminhtml 2.created Productsaveafter.php in Dapl\Shortdurability\Observer. <?php namespace Dapl\...
user avatar
0 votes
1 answer
204 views

Call to a member function getResponse() on null in observer while generating the shipment in magento2.4.3

<event name="sales_order_shipment_save_before"> <observer name="test_beforeshipment" instance="Module\ModuleName\Observer\BeforeShipment" /> </event>...
user avatar
2 votes
2 answers
102 views

What event is fired after a customer places an order?

so I've been looking to do some adjustments with an observer by listening to the event that is fired after a user successfully places an order, whether in the backend or the frontend. But, I don't ...
user avatar
  • 71
0 votes
2 answers
157 views

How to get the selected payment method when the "sales_order_save_after" event is fired?

I'm developing an observable that listen to the sales_order_save_after event. I have the order information executing $observer->getEvent()->getOrder() but i cannot get the payment method ...
user avatar
0 votes
1 answer
33 views

Session parameter set in backend observer not persisting after upgrade to 2.4.3

We have a backend observer that sets a session variable after a shipment is created (sales_order_shipment_save_commit_after). It's been working for over 2 years, but after the latest upgrade to 2.4.3-...
user avatar
  • 814
1 vote
0 answers
126 views

How do WeltPixel Google TagManager extension works

I am using Magento 2.3.5-p2 In it, my team have installed the WeltPixel Google Tag Manager Extension (GTM) this extension is to make the process of GTM Implementation easier the way that the GTM works ...
user avatar
0 votes
0 answers
16 views

How to modify the shipping-address form only at specific locations?

I modified the shipping-address form following this guide to show a legal text on top of the form: Add new field in address form I used a text field with a default value that gets translated for ...
user avatar
  • 17
0 votes
2 answers
142 views

Include js file script in php observer file

I am using Magento 2.3.5-p2 I am adding a new module to add an Observer that will trigger some js code during an event that happens below are the file and its content I have added File Name and Path : ...
user avatar
0 votes
0 answers
32 views

Magento 2 Get Event When User View List Product, Sorting, Filter, Clear Options, Pagination, Add Wish List

I am using Magento 2.3.5-p2 As stated in the title, I want to capture an event by the user when the user does any of the processes below User View List Product User Sort Product User Filter Product ...
user avatar
0 votes
0 answers
346 views

Magento 2: Get custom field value from checkout in observer

I have created a custom field on checkout before shipping method like this: etc/di.xml : <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&...
user avatar
0 votes
0 answers
37 views

How to know the method available for Magento_Customer/js/customer-data

I am doing a Google Tag Integration on Magento 2.3.5-p2 which require me to capture an event that happens during add to cart and remove it from the cart to capture this event I put in code as below at ...
user avatar
0 votes
1 answer
253 views

create event/observer of click new custom button

I need to create a new button in edit address book page, and an email will be sent once we click on this button, any suggestions please?
user avatar
0 votes
1 answer
66 views

Layout load before event isn't triggered

I have an event <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/...
user avatar
  • 772
0 votes
3 answers
69 views

get all order information from checkout_onepage_controller_success_action

I have an Observer for checkout_onepage_controller_success_action and I would like to load ALL order information inside this observer: order items, options, customer info. I have tried a number of ...
user avatar

1
2 3 4 5
43