Skip to main content
Tweeted twitter.com/#!/StackMagento/status/471514339409952768
added 10 characters in body
Source Link
Maurice
  • 313
  • 1
  • 3
  • 12

I suspect that because this event is fired during the create/update of a quote item, not the original product data is used, but a (partial) snapshot of it's data. If that is the case; how might I make my attribute available in this snapshot as well?

I suspect that because this event is fired during the create/update of a quote item, not the original product data is used, but a snapshot of it's data. If that is the case; how might I make my attribute available in this snapshot as well?

I suspect that because this event is fired during the create/update of a quote item, not the original product data is used, but a (partial) snapshot of it's data. If that is the case; how might I make my attribute available in this snapshot as well?

added 7 characters in body
Source Link
Maurice
  • 313
  • 1
  • 3
  • 12

I suspect that because this event is fired during the create/update of a quote item, not the original product data is used, but a snapshot of it's data. If that is the case; how might I make my attribute available in this snapshot as well?



I suspect that because this event is fired during the create/update of a quote item, not the original product data is used, but a snapshot of it's data. If that is the case; how might I make my attribute available in this snapshot as well?


I suspect that because this event is fired during the create/update of a quote item, not the original product data is used, but a snapshot of it's data. If that is the case; how might I make my attribute available in this snapshot as well?


I suspect that because this event is fired during the create/update of a quote item, not the original product data is used, but a snapshot of it's data. If that is the case; how might I make my attribute available in this snapshot as well?


added 1163 characters in body
Source Link
Maurice
  • 313
  • 1
  • 3
  • 12

config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <My_Module>
            <version>1.0.0</version>
        </My_Module>
    </modules>
    <global>
        <events>
            <catalog_product_get_final_price>
                <observers>
                    <my_observer>
                        <class>My_Module_Model_Observer</class>
                        <method>calculateItemPrice</method>
                    </my_observer>
                </observers>
            </catalog_product_get_final_price>
        </events>
    </global>
</config>

Observer

<?php
class My_Module_Model_Observer
{
    /**
     * 
     * @param  Varien_Event_Observer $observer
     * @return void
     */
    public function calculateItemPrice( Varien_Event_Observer $observer )
    {
        $event   = $observer->getEvent();
        $product = $event->getProduct();
        
        // folowing returns NULL
        $product->getMyCustromAttribute()
    }
}

config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <My_Module>
            <version>1.0.0</version>
        </My_Module>
    </modules>
    <global>
        <events>
            <catalog_product_get_final_price>
                <observers>
                    <my_observer>
                        <class>My_Module_Model_Observer</class>
                        <method>calculateItemPrice</method>
                    </my_observer>
                </observers>
            </catalog_product_get_final_price>
        </events>
    </global>
</config>

Observer

<?php
class My_Module_Model_Observer
{
    /**
     * 
     * @param  Varien_Event_Observer $observer
     * @return void
     */
    public function calculateItemPrice( Varien_Event_Observer $observer )
    {
        $event   = $observer->getEvent();
        $product = $event->getProduct();
        
        // folowing returns NULL
        $product->getMyCustromAttribute()
    }
}
added 666 characters in body
Source Link
Maurice
  • 313
  • 1
  • 3
  • 12
Loading
Source Link
Maurice
  • 313
  • 1
  • 3
  • 12
Loading