Magento - Show product value in backend

Is there a way to show the value of a product as a magento (backend) order? So far I have not found an extension that does this (maybe you will do it :)), so I think I will have to do it myself.

What would be an effective way to do this? Maybe rewriting the admin template? Or maybe there are settings for this that I simply could not find.

Thanks in advance:)

+3
source share
4 answers

To do this, edit the two templates from the section adminhtml. In sales/order/view/items.phtmladding new <col>and <th>for your column. Then sales/order/view/items/renderer/default.phtmladd the appropriate <td>field for this. Use something like this to get the value:

<td><?php print Mage::getModel("catalog/product")->load($_item->getProductId())->getCost(); ?></td>

, !

,

+1

. "" , . .

. , .

+1

did it quickly:

  <?php 
        if ($children = $_item->getChildrenItems())
        {
            $children = $_item->getChildrenItems();
            $ProductId = $children[0]->getProductId();
        } 
        else 
        {
            $ProductId = $_item->getProductId();
        } 
  ?>    
0
source

First you can create an attribute for the product, set the config attribute in the product. Well, you can get this attribute using the Magento object. Example:

$product = Mage::getModel('catalog/product');
echo $product->getAttributeName();
0
source

Source: https://habr.com/ru/post/1796294/


All Articles