1

I am using this custom module https://bitbucket.org/vovsky/adding-custom-product-attribute-to-quote-and-order-items-in/downloads related article https://www.atwix.com/magento/custom-product-attribute-quote-order-item/

which allows a custom attribute to be added when adding products

when this product is purchased it stores the numerical data entered in this attribute to mage_sales_flat_order

Unfortunately it doesnt show up anywhere on the order info? How would I display this on the admin panel order summary page or on the individual order page?

  • I am using this module for extra fees github.com/yvoronoy/magento-extension-extra-fee In the checkout page extra fees field displayed and applied in grand total everything okay, in the order page the extra fees field not visible, the grand total applied with extra fees but extra fees column not visible, any help thanks. The only issue is extra field column not visible on backend? – zus Sep 9 at 14:40
1

You would need to edit the template file directly. Depending on where exactly on the order page you want it displayed, but it would be in this folder:

 app/design/adminhtml/default/default/template/sales/order/view/

The most common one is in info.phtml. You will see at the top, it instantiates the $_order object, so anywhere in the file you can just call $_order->getData('my_custom_attribute')

| improve this answer | |
  • /sales/item/column/name.phtml tried adding <?php echo $_order->getData('custom_attribute') ?> and as you suggested <?php echo $_order->getData('my_custom_attribute') ?> and it breaks the page sorry I am truely a novice to this – user3677211 Jun 30 '16 at 14:33
  • This template renders every item line, so it natively doesn't load the order there but if you shove $_order = Mage::registry('current_order'); it should then work. Although it will display the same information on every line, since this attribute is assigned to the order. – Mayers Jun 30 '16 at 14:38
  • Although, reading your original question, it's a big ambiguous. Not sure if the attribute is on the order, or on the order item. If the latter, just use $_item->getData('my_custom_attribute') (obviously replace 'my_custom_attribute' with the attribute code you want to display) – Mayers Jun 30 '16 at 14:39
  • upon installing this custom module it adds a field to the add/edit product for Custom_Attribute aka custom_attribute in my case is being used as profit margin data so each product has a different profit margin amount not sure where its storing the data however i do see a column in mage_sales_flat_order for the Custom_Attribute however it is not displaying the data that was entered when i edit the product not sure where it was being stored. i would assume the product order item? – user3677211 Jun 30 '16 at 14:42
  • mage_catalog_product_entity_varchar I added "matchthis" to the product field and found this in the sql at mage_catalog_product_entity_varchar Value ID entity_type_id Entity Type ID attribute_id Attribute ID store_id Store ID entity_id Entity ID value Value Edit Edit Copy Copy Delete Delete 160305 4 204 0 38 matchthis – user3677211 Jun 30 '16 at 14:52
1

You may add custom admin theme to display an extra product attribute at order, shipment and invoice views at once:
config.xml:

<config>
<!-- other -->
<stores>
    <admin>
        <design>
            <theme>
                <template>custom</template>
            </theme>
        </design>
    </admin>
</stores>

Then copy app/design/adminhtml/default/default/template/sales/items/column/name.phtml into app/design/adminhtml/default/custom/template/sales/items/column/name.phtml and fetch your attribute:

<?php if ($customAttr = $_item->getProduct()->getCustomAttr()):?>
    <?php $attrLabel = Mage::getModel('catalog/resource_eav_attribute')
        ->loadByCode('catalog_product', 'custom_attr')
        ->getFrontendLabel()
?>
    <dl class="item-options"><dt><?php echo $attrLabel ?></dt><dd><?php echo $customAttr ?></dd></dl>
| improve this answer | |
  • I am using this module for extra fees github.com/yvoronoy/magento-extension-extra-fee In the checkout page extra fees field displayed and applied in grand total everything okay, in the order page the extra fees field not visible, the grand total applied with extra fees but extra fees column not visible, any help thanks. The only issue is extra field column not visible on backend? – zus Sep 9 at 14:39
  • I think you need to add custom row total for extra fee, like described here, e.g. blog.magestore.com/magento-certificate-show-custom-total . And fetch your applied rule info from order (applie_rule_ids column in sales_flat_order table) – Анастасия Ермолик Sep 9 at 15:44
  • FYI My grand total updated along with extra fees, the only issue is the field extra Fees visible in the grand total in the frontend snipboard.io/fdQN52.jpg but not visible in the grand total in the backend snipboard.io/JGuBUL.jpg – zus Sep 9 at 16:11

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.