Magento - Add custom attribute to order

前端 未结 1 839
予麋鹿
予麋鹿 2020-12-28 17:06

I\'m trying to add a custom field to my orders. At this moment, I found the post bellow that helped me to create such attribute in my database: http://fabrizioballiano.net/2

1条回答
  •  悲哀的现实
    2020-12-28 17:22

    Add this to the gobal scope in config.xml. Then simply set the attribute in the quote - it gets automagically transferred to the order in the quote to order conversion process.

    
    ...
        
            
                
                    *
                
            
        
    ...
    
    

    You can retrieve/set the attribute at any time via the magic getter/setter e.g.

    $quote->getYourSpecialAttribute()
    $order->getYourSpecialAttribute()
    
    $quote->setYourSpecialAttribute()
    

    0 讨论(0)
提交回复
热议问题