I am wanting to simply add the value from a products attributes ("supplier_code") to an order invoice in a custom extension. The extension is designed to create purchase orders however there are key items missing from their extension like comments and supplier details (ie codes ect)

here is a snippet of code from the page that I am wanting to add the attributes to. here you can easily add things like sku and description as these are loaded already. and here is code they have for custom options of the ring order.

$collection = Mage::getModel("purchasemanagement/orderitem")->getCollection()->addFieldToFilter("purchase_id",$this->getRequest()->getParam("id"));
            foreach ($collection as $order_item) {          ?>
                <tbody class="<?php if($count % 2 == 0)echo 'even';else echo 'odd';?>">
                    <tr class="border">
                            <div class="item-container">
                                <div class="item-text">
                                    <h5 class="title">
                                        <span><?php echo $order_item->getDescription(); ?></span>
                                    <h5>Supplier Code: <?php echo $order_item->getAttributeText("supplier_code"); ?></h5>

I am trying to show the attribute text for supplier code but it is just blank with no errors.

Any suggestions as to what I am doing wrong would be great.

  • Can anyone then suggest how to simply add attribute in admin invoice foreach? – Craig Gillett Jul 18 at 9:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.