Magento - 在后端显示产品成本
有没有办法在magento的订单视图(后端)中显示产品成本?到目前为止,我还没有找到一个扩展可以做到这一点(也许你会:)),所以我想我必须自己做。
做到这一点的有效方法是什么?也许通过覆盖管理模板?或者也许有一个我无法找到的设置。
提前致谢 :)
Is there any way of showing to product cost in magento´s order view (backend)? So far I have not found an extension that does this (maybe you will :) ), so I guess I will have to do it myself.
What would be an efficient way of doing this? Maybe by overwriting the admin template? Or maybe there is a setting for this I just wasn't able to find.
Thanks in advance :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
为此,请从
adminhtml
部分编辑两个模板。在sales/order/view/items.phtml
中,为您的列添加新的和
。然后,在
sales/order/view/items/renderer/default.phtml
中,为该字段添加相应的。使用这样的东西来获取成本:
希望有帮助!
谢谢,
乔
To do this, edit two templates from the
adminhtml
section. Insales/order/view/items.phtml
, add a new<col>
and<th>
for your column. Then, insales/order/view/items/renderer/default.phtml
, add the corresponding<td>
for that field. Use something like this to get the cost:Hope that helps!
Thanks,
Joe
我有同样的问题。
然后我检查了“成本”属性,发现该属性被分配给某些类型的产品。
所以我对所有产品类型都进行了更改。
这对我有用。
希望这对你有用。
I had same issue.
Then I have checked "cost" attribute and found that this attribute is assigned to some types of products.
So I changed it for all product types.
This works for me.
Hope this works for you.
以快速的方式做到了:
did it the quick way:
首先,您可以创建产品属性,在产品中设置属性配置。好吧,你可以通过 Magento 对象获取这个属性。例子:
At first you can create attribute for product, set attribute config in product. Well, you can get this attribute by Magento object. Example: