Questions tagged [event-observer]

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

Filter by
Sorted by
Tagged with
4 votes
2 answers
1k views

How to stop login from customerLogin observer

I would like to deny login for a customer group. Following an example I got a working observer but I am not able to stop the login process: public function customerLogin($observer) { $customer = $...
PiTheNumber's user avatar
  • 3,214
2 votes
1 answer
4k views

SQLSTATE[HY000]: General error: 2006 MySQL server has gone away on running cron job magento

I am working on site .suddenly i got this message on running cron job multiple times.i check my website for the same error but it works.I remove the cache and try to exit the code but after the error ...
Mahmood Rehman's user avatar
10 votes
3 answers
7k views

Event/Observer for customer password change?

I'm looking for a way to hook into the event of customers changing their passwords. So if someone changes the password in the customer frontend, I'd like to send an e-mail somewhere. I did consult ...
oschloebe's user avatar
  • 926
2 votes
1 answer
1k views

Failed opening 'Mage/Sync/Model/Observer.php' for inclusion

I am trying to make an extension containing an observer. But magento search the model in mage instead of my local extension "Test". system.log tells me: Failed opening 'Mage/Sync/Model/Observer....
PiTheNumber's user avatar
  • 3,214
2 votes
1 answer
359 views

Ordering Modules that both use sales_order_place_after observer

I'm writing two custom modules that act independently on the sales_order_place_after event observer and modify order state and status. One module (Module A) will act on every order and update the ...
James's user avatar
  • 458
3 votes
1 answer
169 views

Is it possible to add an event (hook) to a core action without overriding it?

I'd like to add a hook to a Magento core action (in this specific case Mage_Adminhtml_Sales_Order_CreateController::saveAction() but I hope there's a general solution). Just a hunch, but it seems to ...
PartialOrder's user avatar
0 votes
4 answers
6k views

How to call Observer in magento ( Observer not fuctioning )?

I have set an event-observer in my custom module but observer is not getting called. i have enabled my log and i am getting this warning : 2013-08-14T11:17:48+00:00 ERR (3): Warning: include(Mage/...
Sarvagya's user avatar
  • 1,217
0 votes
1 answer
431 views

Login Observer - Get Address after Registration Redirect

I have an observer set up for customer login, and it is firing exactly as I need it to. I need to have access to the customer's default shipping address within the observer, which I load via: $...
Jeff Lambert's user avatar
3 votes
3 answers
5k views

Set Error Message Once Per Page Request

I'm trying to create a minimum total checkout module that will prevent someone from checking out with a total less than a configurable amount. I'm using the event sales_quote_save_before to display ...
Steve Robbins's user avatar
12 votes
2 answers
15k views

How can i get customer data from observer after successful login?

I have made a custom module in which I have an observer file. I need to display all information about the logged in user.
user2656802's user avatar
0 votes
3 answers
2k views

Save admin name to order_status change using an Observer

I am trying to figure out which event to observe in order to save the name of a logged in admin that changes an order state making it visible in the order comments. I have been able to observe other ...
user1704524's user avatar
  • 2,483
2 votes
2 answers
2k views

Observer for Contact Form

I need to pass information from the Magento Contact Form to a CRM system. I was wondering does anyone know if there is an observer that can be triggered to pass the form information to the CRM via the ...
Paul Donnelly's user avatar
0 votes
1 answer
2k views

How to generate Coupon rule dynamically using observer/model method?

How can i generate coupon rule dynamically using observer method? I have created below function, it works if we create controller action and run. But not working with observer. function createCoupon(...
Bijal Bhavsar's user avatar
2 votes
2 answers
4k views

How to show validation error from Observer on frontend?

I'm customizing one page checkout and want to add validation of new field during billing step. To make this validation I don't want to rewrite controller or model, but want to use observer ...
Viacheslav Kondratiuk's user avatar
0 votes
2 answers
457 views

Magento conditional form display

I want do display a form based on what product / option is chosen, when a user wants to buy this product he has to fill in that extra form so a contract can be printed from that data. I have 2 ways in ...
Toon Van Dooren's user avatar
0 votes
1 answer
3k views

Observer - Stop controller action after review_save_after

I am using Magento 1.7.0.2. I need to prevent ratings in the frontend from saving after the reviews has been saved. So I have used the <reveiw_save_after> event in order to achieve it. But I am ...
Dinesh's user avatar
  • 131
8 votes
3 answers
3k views

Unregister event observer programatically

Does anyone know if it's possible to unregister an event observer programatically? I have an observer on newsletter_subscribe_save_after that updates a custom attribute in the customer model but when ...
Richard Cleverley's user avatar
0 votes
1 answer
535 views

Conditional tab with upsell like grid with pagination

I have added an upsell like grid to the simple products tab conditionally trough an observer like this: $block = $observer->getEvent()->getBlock(); if ($block instanceof ...
Toon Van Dooren's user avatar
32 votes
4 answers
20k views

Modify tax rate on cart quote items and recalculate

I have a category of products which (legally) need to have their tax rate changed when you are ordering more than a certain quantity. I have extended the various tax models to get this working when ...
McNab's user avatar
  • 1,078
3 votes
3 answers
2k views

How to prevent extension installation problems with compilation mode enabling

I have the extension which is listening to core_layout_block_create_after event. It could be any event which is firing in magento admin. Also I have magento instance with compiler mode enabled. I ...
oleksii.svarychevskyi's user avatar
0 votes
1 answer
1k views

Overwrite getProductUrl function

The goal is that we want to be able to change the url under some conditions for all product URLs. It seems that the solution would be to add a function to our module Observer.php. I can't quite get ...
Quantum's user avatar
  • 553
3 votes
2 answers
5k views

Observer not firing

Can you see why my observer is not firing? config.xml: <?xml version="1.0" encoding="UTF-8"?> <config> <modules> <Caitlinhavener_Dynamicprice> &...
CaitlinHavener's user avatar
2 votes
3 answers
3k views

Filter Payment Method besed on Shipping Method

I develop observer method in Magento for filter payment methods based on shipping methods. This is my method: class Devpassion_Paymentfilter_Model_Observer { public function paymentMethodIsActive(...
srdan's user avatar
  • 348
1 vote
2 answers
6k views

Why is checkout_cart_save_after thrown immediately after sales_quote_save_after?

The implementation of the Mage_Checkout_Model_Cart::save() method seems to result in duplication of events. Why is the non-standard checkout_cart_save_after event thrown immediately after the generic ...
Jonathan Day's user avatar
2 votes
3 answers
4k views

Best Practice: How to add a column to a backend grid ?

Usually we need to add to the Order Grid some column, so let take this as example. There are 3 ways to do that: Rewrite the grid block in our custom module Use an observer on the event ...
Fra's user avatar
  • 6,955
1 vote
1 answer
2k views

What events to use for update of custom prices upon "Proceed to checkout" and "Submit Order"

I have made a module that sets custom prices of quote items upon a cart update. For that I use these events: checkout_cart_product_add_after sales_quote_remove_item checkout_cart_update_items_after ...
clime's user avatar
  • 247
0 votes
1 answer
2k views

Email template variable missing when overriding observer of core module

Hello all i want to do some changes in Magento Enterprise's Gift card functionality so that i have override the observer of Enterprise_Giftcard module into my local module Essentiel_Giftcards and its ...
Abhijeet kumar sharma's user avatar
0 votes
1 answer
206 views

Magento Event For Returning Visitor

I am looking to hook into a event that will tell me when a returning customer visits the site. I was thinking about hooking into one of the session events, my question is, how would you go about ...
Jeffrey L. Roberts's user avatar
3 votes
3 answers
5k views

dynamically adding layout updates xml files

In an extension i am working on, i have this section in the module's config.xml- <config> <frontend> <layout> <updates> <...
Mridul Aggarwal's user avatar
1 vote
1 answer
3k views

Need event observer for the import product save row controller

how can i catch import product Mage_Catalog_Model_Convert_Adapter_Product model saverow() event using observer. Mage::dispatchEvent('catalog_product_import_profile_after', array('adapter'=>$this));...
Jalpesh Patel's user avatar
1 vote
3 answers
805 views

Observer's getCollection() not being rewritten

Is this standard behavior, or am I doing something wrong? // in event 'catalog_product_collection_load_before' get_class($observer->getCollection()); > ...
mpw's user avatar
  • 1,050
1 vote
1 answer
1k views

Which observer to use during checkout order lock?

We're currently searching for an observer to use while a submitted order is locked during the checkout process. We've found that Mage_CatalogInventory_Model_Observer::lockOrderInventoryData is ...
oschloebe's user avatar
  • 926
2 votes
2 answers
228 views

Event is not firing up after the 2-3 hour long import process

I again ran into a weird issue. I have registered an observer for an event that is firing up when the Advance data flow profile finishes its execution completely. I have checked this successfully when ...
Ravi Soni's user avatar
  • 1,515
0 votes
2 answers
1k views

Trouble while getting product collection in observer

i am trying building a small module which house a Observer for getting called when and event called when catalog_product_import_profile_after is fired this is custom event which i have fired using the ...
Ravi Soni's user avatar
  • 1,515
2 votes
1 answer
15k views

Redirect to module/controller/action

How to redirect to module/controller/action when I'm inside an observer method? I need to redirect to myrouter/adminhtml_test/validate. Why I need this: I try to fire my controller's action which has ...
zitix's user avatar
  • 2,192
7 votes
4 answers
13k views

Call action after "Save Config" was clicked in the admin

How can I call an action of my controller in a custom module after "Save Config" was clicked in System --> Configuration --> Catalog? (image) Settings of my module are inside that section, and I need ...
zitix's user avatar
  • 2,192
4 votes
3 answers
1k views

Taking action on a cancelled Recurring Profile

Using the default Magento Recurring profiles, is it possible, either through Event/Observer or a cron job to determine which profiles have been cancelled or suspended and take some subsequent action, ...
user1873's user avatar
3 votes
1 answer
2k views

Custom observer events

I have created an API integration with a third-party retailer. I have created my own Mage::dispatchEvent calls before and after the communication. I mostly use these for logging/debug mode, but I now ...
philwinkle's user avatar
  • 35.8k
5 votes
1 answer
6k views

checkout_submit_all_after Observer only triggered from one store view?

Afternoon all, Run into a curious problem, I'm setting up an observer that will be triggered every time an order is made. Code is below; Config XML: <?xml version="1.0"?> <config> &...
thebluefox's user avatar
16 votes
1 answer
10k views

Why are my SOAP v2 WS-I calls so slow (7-10 sec. per product update)?

We're using the Magento SOAP v2 API with WS-I. The problem is, that the SOAP calls are extremly slow (7-10 seconds per product!). We're calling catalogProductUpdate without images. The shop itself ...
Anna Völkl's user avatar
  • 17.3k
15 votes
2 answers
11k views

Creating Custom option and prize to just added product to cart using observer

I want to add custom option to quoteitem using observer which observer checkoutCartProductAddAfter event and fires after product added to cart. public function checkoutCartProductAddAfter(...
Keyur Patel's user avatar
9 votes
3 answers
13k views

Observing order state change

It seems there is no order state event by default, so how do you usually go about observing order state change? There are two possibilities I see: a) Overwrite the sales/order model to create your ...
mpaepper's user avatar
  • 4,700
5 votes
2 answers
100 views

No order until the first one is paid

I need to create a module where it checks if the Customer has an order, and if he does check if its Paid(aka in Complete state), if yes let him order again, if not do not let him order. I thought of ...
NaGeL182's user avatar
  • 183
4 votes
1 answer
1k views

checkout_cart_add_product_complete not fired. Bug or feature?

While trying to answer this question I ran into a strange behavior. The checkout_cart_add_product_complete event is working nice while adding a product to cart from a catalog. However if I try to ...
user487772's user avatar
  • 11.6k
1 vote
1 answer
969 views

Display Message On Thank You Page If Shipping Method Is Equal To

We have added an in-store pick up shipping method to our magento stores. We would like to display travel instructions to the store on the thank you page. Any ideas on how I can go about displaying ...
Jeffrey L. Roberts's user avatar
27 votes
4 answers
4k views

Returning $this after observer

I see some conflicting information on the internet and in 3rd party modules alike - is it a requirement or best practice to return $this at the end of an observer method? E.g.: ...
philwinkle's user avatar
  • 35.8k
4 votes
1 answer
8k views

Hook into "order shipped" event and get order id for order shipped

I have created a module that hooks into the sales_order_shipment_save_after event. I have tested the hook is working with Mage::log, My question is, how do I get the order id for the shipment that ...
Jeffrey L. Roberts's user avatar
11 votes
3 answers
3k views

How can I alter a string passed by an event?

In my observer function, I get a variable passed by the event like that: public function observerFunc(Varien_Event_Observer $observer) { $sth = $observer->getEvent()->getSth(); } If sth is ...
Simon's user avatar
  • 5,695
9 votes
4 answers
4k views

Magento Observer Events - order of operations

I am attempting to inject functionality into the catalog_model_product_duplicate event. Part of this module will be to ensure that the stock status of the duplicated product is also duplicated; ...
philwinkle's user avatar
  • 35.8k
1 vote
2 answers
6k views

How to Know The Magento Event that We Want to Hook [duplicate]

My question is simple, how to know the Magento event that we want to hook? Is there any simple solution?
Wakanina's user avatar
  • 764