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
1answer
1k views

Using observer, how to get the current pager with loaded product collection

Using an observer how can i get the current pager block with its loaded product collection on a category page? I want to check the total number of pages on a category page before it is loaded.
2
votes
2answers
174 views

model name in obsever - use full or alias

When creating an observer, in config is there a preference over the two following styles and if so which and why? <observers> <me_mymodule> ...
1
vote
2answers
281 views

Should observer code always been wrapped in try catch

Just as the title asks, should code inside an observer always be wrapped in a try catch? I read this somewhere a long time ago and have always written observers in such this way since. Is this ...
0
votes
2answers
460 views

Is it possible to use an observer to add a checkout button after product has been added to shopping cart?

I have been scratching my head for nearly three hours trying to figure out how I could add a "checkout" button to a page once a product has been successfully added to the shopping cart. I have ...
0
votes
1answer
2k views

Append block to admin login form

I need to append a input field to the admin log in page. I have created an Observer.php hoping to do so. I simply want to add an input to the login form on the admin side. app\code\local\Wsu\...
4
votes
2answers
3k views

How to display only the Inventory Tab in admin Product edit section?

The Product edit section (Catalog->Manage Products -> edit) I want to display only the Inventory tab for a particular admin user role. For instance an admin user with "test" as user role should only ...
2
votes
1answer
6k views

update layout in observer

I'm trying to change the layout of the success page with an observer at Mage_Checkout_OnepageController::successAction() on Mage::dispatchEvent('checkout_onepage_controller_success_action', array('...
5
votes
2answers
568 views

What order the same event will fire if it is captured in several modules? [duplicate]

I want to listen to an event by using an observer in my module. There are some other module observers as well which are listening the same event. So is there any particular order of firing the ...
0
votes
2answers
274 views

What is the event fires when customer logged in and initialize the cart?

What event is fire when initialize the shopping cart just after the customer logged in? This event should set the remained cart items as well as the grand total and subtotal for that cart. Can anyone ...
0
votes
1answer
819 views

How to trigger an event only on record creation and not on updation?

I have a custom admin grid module. When I add an item to that grid it calls the saveAction() in the controller of my module (obviously). I need to trigger a custom event after the record gets saved (...
2
votes
2answers
8k views

Get just the SIMPLE products ordered from a quote when Configurable Products are purchased

I have an observer attached to sales_order_place_before and from that event I am getting the order items using $event = $observer->getEvent(); $order = $event->getOrder(); $items = $...
1
vote
1answer
102 views

Please some advanced users can help me?

Ok this is getting really serious here. I will continue explaining the code first. This is my WSDL path connection: $client = new SoapClient('http://xxxxxxxxxxxxx', array("connection_timeout"=>...
0
votes
1answer
7k views

Event fired before product save [closed]

This event will work before saving the product because i need one observer which will work before product save. "catalog_product_prepare_save"
2
votes
1answer
843 views

What is the event fires when change the grand total in cart?

I want to write an observer function which will fire whenever the cart total is changing. Eg: When add/remove products in the cart, Add rewards/coupon codes to the cart My observer function will ...
1
vote
0answers
4k views

trying to get the subtotal and Grandtotal from an order but the result is always NULL [closed]

I'm trying to get the subtotal and Grandtotal from an order but the result is always NULL. I have try a lot of solutions that i found online but nothing works.. The event that i wait is: ...
0
votes
1answer
164 views

Same front-end action triggers different events?

On the front-end, a user can save his account information (name, address, etc.). Let's call this action user-save. I'm finding that when the user doesn't have any address information, user-save ...
2
votes
1answer
5k views

How to get associated event name from observer

Say I have an observer, and I want to get the name of the event that's associated with it. What's the proper way to get this string, if it's possible? e.g. customer_save_after or ...
18
votes
3answers
11k views

Creating Custom Option on Product Save

I'm working on creating a custom option for my products automatically any time a product is created. What I've got so far is an observer that fires on the catalog_product_save_before event and runs ...
1
vote
2answers
1k views

observer failed to stream

I have been making and deleting custom modules to learn how magento works and I have now come across this error when I selected System | Permission | Roles | Administrator that error was fixed and now ...
1
vote
1answer
403 views

Trying to pass details from last order event/observers

I am getting this issue now. I can pass the productId but the foreach it looks like it does not work, When customer order 2 items the result i get is just the last item productId. Here is the code: ...
0
votes
1answer
322 views

Confusing events name while listening to observer

I am working on site where i have to listen for the matching events and run code according to that event.when print the code in observer print_r($observer->getEvent()->getControllerAction()-&...
7
votes
3answers
22k views

catalog_product_save_after Event for Massaction

I'm using the event catalog_product_save_after to trigger some action after a product has altered/saved. This event does not work when a massaction is used to change the product as this is done ...
5
votes
1answer
5k views

Add Mass action to grid via observer

I'd like to add mass action column in CMS->Blocks only via observer, and not to overwrite blocks.. ok, so far I have this: code: I'm targeting this event: <events> <...
0
votes
2answers
1k views

What is the event dispatching when abandoned cart save it's data?

I need to save some additional data in sales_flat_quote table. So what is the event which dispatching when the abandoned cart data saves in this table? EDIT: I need to save item names comma ...
1
vote
1answer
372 views

Get Order Info at the ordering moment and send out invoice

I'm am improving Magento plugin that my friend wrote and I need to add a logic where I check each order and if the total sum is less than x then get this order details like total amount, name, address,...
1
vote
1answer
1k views

Event manager extension [closed]

I am looking for a free event(like exhibitions) manager extension that can list events in a list instead of a full calendar. I need to be able to output like: 2013 events August 10th This is a new ...
3
votes
3answers
2k views

Observer for Admin Order Grid

I would like to restrict order based on an Admin user. So for example the admin user would have an attribute that is assigned to a certain region (Group of Zipcodes). When the user logs in they could ...
1
vote
1answer
2k views

Varien_Event_Observer getName() method returns null

I don't understand why the Varien_Event_Observer object has getters and setters for th 'name' attribute. However when using it in the method defined by my config xml, calling getName() returns null? ...
2
votes
3answers
3k views

Manual triggered event does not work

I have an observer for sales_order_place_after and this is working. Now I am generating an order myself and would like to trigger this event but it does not get to my observer. Is something wrong ...
8
votes
4answers
11k views

sales_order_save_commit_after event triggered twice?

I registered an observer for the sales_order_save_commit_after event to be notified when a new order comes in. This works fine but the event is triggered two times in a row with the same order. My ...
4
votes
2answers
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 = $...
2
votes
1answer
3k 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 ...
10
votes
3answers
6k 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 ...
2
votes
1answer
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....
2
votes
1answer
350 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 ...
3
votes
1answer
158 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 ...
0
votes
4answers
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/...
0
votes
1answer
428 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: $...
3
votes
3answers
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 ...
12
votes
2answers
14k 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.
0
votes
3answers
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 ...
2
votes
2answers
1k 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 ...
0
votes
1answer
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(...
2
votes
2answers
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 ...
0
votes
2answers
423 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 ...
0
votes
1answer
2k 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 ...
7
votes
3answers
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 ...
0
votes
1answer
526 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 ...
31
votes
4answers
17k 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 ...
3
votes
3answers
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 ...