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

help showing attributes in invoice
 
fastrack
Member
 
Total Posts:  56
Joined:  2009-02-04
 

I have successfully added certain product attributes to the downloadable items in the cart list by using the following code in :
/downloadable/checkout/cart/item/default.phtml :

<?php echo $this->__('Composer: '); 
echo 
Mage::getModel('catalog/product')->load($this->getProduct()->getId())->getAttributeText('composer'); echo $this->__(' '); echo Mage::getModel('catalog/product')->load($this->getProduct()->getId())->getcomposer_percentage();?>
        
<br/>
<?php echo $this->__('Publisher: '); 
echo 
Mage::getModel('catalog/product')->load($this->getProduct()->getId())->getpublisher(); echo $this->__(' '); echo Mage::getModel('catalog/product')->load($this->getProduct()->getId())->getpublisher_percentage();?>

this shows in the cart a small bit of text under the product name that looks like this:
Composer: composer’s name 100% BMI
Publisher: publisher’s name 100% BMI

the composer attribute has a dropdown input in the backend, and the other three are text field inputs.

what I can’t figure out is how to display the same text in the customer’s invoice view. I tried placing the same code in:
/downloadable/sales/order/invoice/items/renderer/downloadable.phtml
but i the page doesn’ t finish loading and in firebug i’ve found this error:
<b>Fatal error</b>
: Call to a member function getId() on a non-object in
<b>/downloadable/sales/order/invoice/items/renderer/downloadable.phtml</b>

why does this work in the cart but not in the invoice?

another thing I have to do is to show this text on the customer’s invoice EMAIL.

can anyone help me out?
thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
Sonassi
Sr. Member
 
Avatar
Total Posts:  217
Joined:  2009-05-20
Manchester, UK
 

This might help:

http://www.sonassi.com/knowledge-base/magento-knowledge-base/display-attributes-on-invoice-or-packing-slip-in-magento/

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top