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

How to use type for event in xml?

I want to call my observer after the adminhtml_cache_refresh_type event and specifically after full_page This method does not work, is there a way to do this in observer? <event name="...
0
votes
1answer
35 views

Observer function auto call twice in magento 1.9

I have created one function in Observer and set it called on product save after via config.xml file events section. When I press "save & edit continue", this function log all the ...
1
vote
0answers
24 views

Magento 2 : Activation/Deactivation and uninstallation module event

I am writing an extension for Magento 2. When my extension is activated, I want to send a request to my backend to register a merchant. And when the merchant deletes my extension, I also send a DELETE ...
1
vote
1answer
30 views

cannot get session value in different events

I'm using two different events controller pre dispatch and controller post dispatch.I have set customvalue using catalogsession in predispatch event and try to get the value in post dispatch event....
1
vote
1answer
48 views

Magento 2 - What is the Event name after customer edit address only

I need to use events 2 places 1 - When customer verified email <event name="controller_action_predispatch_customer_account_confirm"> <observer name="...
2
votes
1answer
36 views

How to clean cloudways Varnish cache after cleaning statics on magento 2 side

I wrote a class that works if I call it through pure php. It looks something like this class CloudwaysAPIClient { const API_URL = "https://api.cloudways.com/api/v1"; ... public ...
1
vote
1answer
28 views

Fire event observer when product is enabled

I want to fire event observer when products are enabled from admin, I can not find any event for this please help on this. I want to do below things Once the product is enabled or disabled need to ...
1
vote
1answer
25 views

observer to fire on system admin config display

In my plugin I'm trying to create an event observer that should fire when I display my plugin system configuration page. At first I created a new db table f24_staging by \Vendor\MyApp\Setup\...
0
votes
0answers
11 views

How to update the cart from observer

I have some conditions on my store based on the customer billing address. When someone saves their address, I would like to update the items in their cart (and minicart) to ensure correct prices are ...
0
votes
1answer
21 views

I need to set an activity if the customer is created or updated but it is not working in magento 2.3

events.xml (path : app/code/vendor/module/etc/frontend) <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation=&...
0
votes
1answer
29 views

Detect if payment has been placed in sales_order_save_after observer in Magento 2?

I have a custom extension that uses sales_order_save_after basically i want to create an invoice after the customer put a payment data , the problem is the order seems not been created at so i got an ...
1
vote
1answer
55 views

Magento2: magento rest api not triggering my custom plugin and observer?

I have created an observer "checkout_cart_save_before" and plugin Addproduct. It is working perfectly for the website but not triggering for API while hitting on the postman. Any suggestions ...
1
vote
2answers
30 views

How to get all items of product purchased in Magento 2?

I would get information on all items of product purchased. I proceeded by this way but I can not have any information on all items of product purchased : <?php namespace MyTestSpace\...
0
votes
0answers
9 views

Magento 2 : Redirect customer to login page on email change

i want to redirect the customer to the login page when email id is changed from edit form ,i did below code Issues : 1: I am not getting redirected to login page, i can see message **Please Login now*...
0
votes
1answer
88 views

Magento 2 : event observer before customer edit form save

I want to fire event observer before customer account edit details are saved, i am unable to find event observer for it. Is there any observer like customer_account_edited_before.
0
votes
0answers
24 views

magento 2 observer on customer email change

I want to fire observer when customer email is changed, i could not find any event for it. please help with same what i want to is below 1: fire observer on customer update customer details 2: check ...
0
votes
1answer
63 views

I want to create column in sales_order table and view custom field on order edit section in magento 2.3.5

I am added one custom field in checkout address form and i want to store that field data in Database and also display this field in admin order edit page in magento 2.3.5, so anyone can have idea ...
1
vote
1answer
20 views

How can i get customer data after registration?

I have the following code but it is not working. vendorName/moduleName/etc/module.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
1
vote
0answers
10 views

I want to a show a loader during the execution of an observer in magento 2. How can I show the loader?

In an observer to an event, I am creating new products,it takes some time for the products to be created. I want to show loader during this wait. How is it possible?
0
votes
0answers
13 views

On cart add/remove call the magento2 observer

I want to apply promorules while adding/removing products from cart in magento2. for that i added like events.xml as follows. <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/...
0
votes
0answers
23 views

How to send email admin dynamically when order placed

In this I want to create custom module for Send email to admin from one email sending field to get email id and send email on that id after order placed successfully using event and observer and one ...
0
votes
2answers
63 views

Magento 2 Add extension attribute in product list

I want to add extra data in product list rest api using extension attribute via Plugin in Magento 2 but it's not working. > Uncaught TypeError: Argument 2 passed to > Vendor\ModuleName\Plugin\...
0
votes
0answers
31 views

Magento 2: How to change order status of Pending to Payment Received?

Hi i'm new at magento 2 and i want to simulate the order status change of Pending to Payment Received. How can i do this? And which event can i observe to when the order status get changed to Payment ...
0
votes
1answer
18 views

How to get Magento 2 Customer before and after edit Customer data?

I want to implement erp system in my Magento 2.3.4 website, i need to check whether customer has changed his name or dob, if the customer changed it , i need to send the updated data to the erp system,...
0
votes
0answers
8 views

Trigger event , when product comes from search

I want to trigger Product Viewed event , when product is viewed , but only for the product that comes from search results. Any idea how to achieve this ? Thank.
0
votes
0answers
25 views

Magento 2 : How to add observer in core module?

I would like to add a new Observer class in module-checkout and also add this new observer in etc/events.xml. What is the appropriate way to achieve that?
0
votes
2answers
40 views

My Observer is not executing

Hi i'm new at magento 2 and i've been trying to create a Observer for checkout_submit_all_after and looks like that the Observer is not even called. events.xml <config xmlns:xsi="http://www.w3....
1
vote
2answers
67 views

How to Observer place order event?

Hi i'm new at magento 2 and want to get orderId() using Observer on place order event. <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:...
0
votes
1answer
18 views

Magento 2: How to add a class to an observer without construct

I am making this observer class to check if a visitor is logged in. use Magento\Framework\Event\ObserverInterface; use Magento\Customer\Model\Session; class CheckLoginObserver implements ...
0
votes
0answers
13 views

Magento 2: Using API provided user data to automatically create an account

I have a shop that works under a subdomain (shop.example.com). Users can log into the example.com domain, and come to the shop while their session is still active. I want to log them in automatically ...
0
votes
0answers
47 views

Magento 2 Event-Observer is not working

I need to send an email regarding customer login failed to admin in my Magento 2 custom extension. I tried to execute event-observer method but not working. I am a newbie to magento, so I am not sure ...
0
votes
1answer
20 views

Magento 2.3.4: Why doesn't Magento admin configuration take any effect on the `fax` field?

The option for fax under Store->Configuration->Customer->Customer Configuration->Name and Address options was set to NO right from the beginning of the installation of Magento 2. It is ...
0
votes
2answers
75 views

Is there any event for Customer Login Failed in magento 2?

I am creating a new extesnion in Magento 2. I need to send email regarding customer login failed to admin. Is there any event for customer login failed?
0
votes
1answer
23 views

Defining observers with custom method names

Apparently, setting a custom observer method name could be done in magento1: <event name="controller_action_catalog_product_save_entity_after"> <observers> <...
1
vote
0answers
24 views

Magento 1: What is the function “$invoice->register()” for?

I try to generate invoices programmatically in Magento 1.9.4. It works so far with this code: $invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice(); if (!$invoice->...
1
vote
1answer
30 views

Creating a custom tab in configuration with text field, and when updating a product “the word” will append with product name. Magento 1.9

I am creating a small module. In which I have built my own tab in System- Configuration, Name "ZARA" which consists of a textbox. I can enter words in the textbox and save the configuration. Now my ...
2
votes
1answer
277 views

Magento 2 email_order_set_template_vars_before observer triggers only when I resend email in the admin

I created a new template var using email_order_set_template_vars_before observer and it works when I send email new order through the Magento admin. But it does not trigger when new order is placed. ...
1
vote
1answer
170 views

Magento 2 - Can’t save custom Customer attribute value in observer customer_save_after_data_object

I have created three custom attributes for Customer: myapp_id, codice_univoco and indirizzo_pec If I enter a value in codice_univoco and/or indirizzo_pec, data is successfully saved: However, when I ...
0
votes
0answers
16 views

I want to change the order status when the shipment is occurred in magento 2.3

I want to change the order status (custom_status) during the shipping, how to implement this as functionality in magento 2.3
0
votes
1answer
38 views

How to change order invoice pdf for a particular invoice in Magent 2.3.3

Here I want to design and change the invoice PDF of a particular Invoice. I have added an observer to but it's creating a normal invoice. But I want to design and change the PDF of that particular ...
0
votes
0answers
12 views

Use Dynamically option for setting price in observer

I try to use a custom option to set the final price. So I use an observer when adding to cart I replace the price by one of my option. Problem is that the option has a different id according to which ...
0
votes
0answers
64 views

How to create custom payment module in magento 2?

I want to get payment request in Test\Testpayment\Gateway\Request Request.php namespace Test\Testpayment\Gateway\Request; use Magento\Payment\Gateway\ConfigInterface; use Magento\Payment\Gateway\...
0
votes
0answers
19 views

How can i create invoice with custom format and default invoice generated in Magento 2.3.1

Here I want to create a custom invoice with custom format right after the default invoice generation. What I want is Whenever Admin create an invoice. A new invoice should be automatically to be ...
0
votes
1answer
83 views

Dispatch event is firing twice

I created a custom observer in customer_address_save_after event that retrieves customer data and send it via SOAP. So far, so good. My file Vendor/Module/etc/events.xml <?xml version="1.0"?> &...
0
votes
0answers
8 views

Magento Observer On Address Update in checkout

I want to call observer on Address changes and change price of product if Country other than India Is there any way to call observer and add 10 ruppee to all product price if country is other than ...
0
votes
1answer
63 views

Magento 2 - checkout_submit_all_after event is not working after checkout completion

I have need to get Order information in checkout_submit_all_after event observer in Afterpay Payment Method Module. I am trying to add this event in that module. File Path: app/code/Afterpay/Afterpay/...
0
votes
0answers
16 views

Magento 2 FPC invalidate homepage, specific product page and specific category cache in observer

I need to create on observer that should invalidate cache of the homepage, a specific product page and a specific category cache when a trigger occurs. Anyone can help ? Thanks !
0
votes
0answers
14 views

How to go to checkout review section and throw an error in Magento 2?

In my checkout_type_onepage_save_order observer, i have a code to do some validation and it will make the customer go to the checkout review and throw some error, in Magento 1.9 i can do it like this: ...
0
votes
0answers
11 views

Code looks like M2

I have created a custom module using this tutorial that applies a set of rules for available payment methods, based on shipping method selected and shipping address. <?xml version="1.0"?> <...
0
votes
0answers
65 views

How to get custom field value in observer from checkout custom form

hey there here i am trying to save the values my custom checkout form's values in db tables . Here is my custom form. i have used event observer to save values and hard coded values are getting ...

1
2
3 4 5
40