I'm using SNM Mobile Admin to scan and add stock, and I've added a custom attribute called location_shelf, like this:
<div data-role="fieldcontain"> <label for="product[location_shelf]"><?php echo $this->__('Locatiecode') ?></label> <?php $_product = $this->getProduct(); ?> <input type="text" name="product[location_shelf]" id="product[location_shelf]" value="<?php echo $_product->getLocationShelf();?>"/> </div>
It shows perfectly when I scan a product. Now I want to do the same with the order-details page, but it just doesn't show up. The only things that works is:
<?php $model = Mage::getModel('catalog/product') ->getCollection() ->addAttributeToSelect('location_shelf') ->addAttributeToFilter('entity_id',32) ->getFirstItem();?> <p><?php echo $model->getLocationShelf();?> </p>
It only shows one location ofcourse, but editing this piece always leads to an error.
The module's original order view code is based on Mage_Sales_Model_Order
$_order = $this->getOrder();
<?php $_items = $_order->getItemsCollection();?>
to get all the product info. Is there a way to show my custom attribute somewhere in here?
<?php echo $_item->getLocationShelf();?>
doesn't work unfortunately
The errors I get are like this: Call to a member function getLocationShelf() on a non-object
Thanks in advance!