Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 8 of 8
Event dispatch requests
 
rolandow
Jr. Member
 
Total Posts:  11
Joined:  2010-08-16
 

The wiki page says that the catalog_product_get_final_price event doesn’t work anymore. I have the same problem. Is this confirmed yet? I am using Magento CE 1.6.2.0.

@Thylaksoft: why are you publishing the wiki page here?

Note for recent versions of Magento - Broken
Seems like this tutorial doesn’t work anymore for recent versions (1.6.2 for me), because of magento prices indexing. Price is not calculated on the fly on frontend anymore, and indexing does not call the event “catalog_product_get_final_price”. To be confirmed.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Max134
Member
 
Total Posts:  37
Joined:  2010-05-29
 

Hello

I have some functions I want to dispatch after purchase, I mean after customer clic ‘Place Order button and checkout is complete.

I do the following in a custom module.

In app/code/local/Company/Mymodule/etc/config.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <
modules>
        <
Company_mymodule>
            <
version>0.1.0</version>
        </
Company_mymodule>
    </
modules>
    
    
    <
frontend>
        <
events>
          <
checkout_type_onepage_save_order_after>
            <
observers>
              <
company_mymodule_observer>
                <
type>singleton</type>
                <class>
company_mymodule_observer</class>
                <
method>doSomething</method>
              </
company_mymodule_observer>
            </
observers>
          </
checkout_type_onepage_save_order_after>
        </
events>
   </
frontend>
</
config>

And in app/code/local/Company/Mymodule/Model/Observer.php

<?php
class Company_Mymodule_Model_Observer
{
    
public function doSomething($observer){
        
//some code
    
}
        
}

I try to change <checkout_type_onepage_save_order_after> with <checkout_submit_all_after>, but still doesn’t works.

What’s wrong in the code.

Thanks in advance

 
Magento Community Magento Community
Magento Community
Magento Community
 
cahouet
Jr. Member
 
Total Posts:  2
Joined:  2012-01-17
 

Hi,

I have a request : I need to change the group id for a customer when he change/save his address on the frontend. I wrote a module which is not working. Actually, I worked on 2 events: customer_save_before event and customer_address_save_before/after and there are 2 process differents.

First, with customer_save_before event, the changes work on the backend, when I change the adress. But in the frontend, when a customer change his address, it does’nt work…

With customer_address_save_before and customer_address_save_after events, the id finaly does’nt change. BUT, I cheked by logging and debugging that in the process, the group_id was indeed changed !! But finally, the group id was the same as before.

Here is the config.xml of my module with customer_save_before event:

<?xml version="1.0"?>
<config>
    <
modules>
        <
Fontis_Customer>
            <
version>1.0</version>
        </
Fontis_Customer>
    </
modules>
    <global>
        <
events>
            <
customer_save_before>
                <
observers>
                    <
fontis_customer_save_before>
                        <
type>singleton</type>
                        <class>
Fontis_Customer_Model_Customer_Observer</class>
                        <
method>customer_save_before</method>
                    </
fontis_customer_save_before>
                </
observers>
            </
customer_save_before>
        </
events>
    </global>
</
config>

And with customer_address_save_before :

<?xml version="1.0"?>
<config>
    <
modules>
        <
Fontis_Customer>
            <
version>1.0</version>
        </
Fontis_Customer>
    </
modules>
    <global>
        <
events>
            <
customer_address_save_before>
                <
observers>
                    <
fontis_customer_address_save_before>
                        <
type>singleton</type>
                        <class>
Fontis_Customer_Model_Customer_Observer</class>
                        <
method>customer_address_save_before</method>
                    </
fontis_customer_address_save_before>
                </
observers>
            </
customer_address_save_before>
        </
events>
    </global>
</
config>

In attachements the two versions of observer.php

Do you know if I missed something? Is there another way to do what I want to do?

Thanks for helping !

File Attachments
Observer.php  (File Size: 4KB - Downloads: 51)
Observer.php  (File Size: 4KB - Downloads: 54)
 
Magento Community Magento Community
Magento Community
Magento Community
 
kiatng
Enthusiast
 
Total Posts:  875
Joined:  2008-09-03
Kuala Lumpur, Malaysia
 

Is there an event after the add to cart button is clicked but before the cart is saved? I need this for validation of product options so I can throw an exception if the validaiton failed.

There is an event after the cart is saved in Mage_Checkout_CartController:

Mage::dispatchEvent('checkout_cart_add_product_complete',
  array(
'product' => $product'request' => $this->getRequest(), 'response' => $this->getResponse())
  );

But I need an event before the cart is saved.  The closest I find is the ‘quote_save_before’ event but this is not ideal as it does not indicate the last added product.

If none is available, I’d like to request for an event ‘checkout_cart_add_product_before’, with the same params as ‘checkout_cart_add_product_complete’.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ryan Sun _Kuafu
Guru
 
Total Posts:  317
Joined:  2008-11-14
FL
 

add event dispatcher in
_prepareLayout in Mage_Core_Block_Abstract
and
_prepareCollection in Mage_Adminhtml_Block_Widget_Grid
also add an event prefix
PLEASE!

 
Magento Community Magento Community
Magento Community
Magento Community
 
oharepa
Jr. Member
 
Total Posts:  14
Joined:  2013-09-19
 

Hi all!

I’m trying to write an observer to add data from a custom attribute field from my customer registration page. I know that the event is ‘customer_register_success’ but i don’t know where to go from there. My attribute is membership_number.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 8 of 8