【问题标题】:Magento - Show Custom Product Attribute on My Account Order Information PageMagento - 在我的帐户订单信息页面上显示自定义产品属性
【发布时间】:2016-01-08 10:29:35
【问题描述】:

在管理员中创建属性并将它们分配给产品,它们可以在购物车页面上看到,如下页所示

Cart Info

我已经在config.xml中添加了代码,如图所示

<sales>
         <quote>
            <item>
            <product_attributes>
                <my_custom_product_attribute/>
            </product_attributes>
            </item>
         </quote>
</sales>

下订单后,如何在客户的我的订单页面下的订单信息页面显示相同的属性。

Order Info

在 config.xml 中尝试过,但我需要在客户的订单信息、发票和退款页面以及管理部分中显示自定义产品属性

<global>
    ...
    <fieldsets>
        <sales_convert_quote>
            <your_special_attribute>
                <to_order>*</to_order>
            </your_special_attribute>
        </sales_convert_quote>
    </fieldsets>
    ...
    </global>

【问题讨论】:

    标签: magento magento-1.9


    【解决方案1】:

    在orders.phtml 文件中,从order oject 中获取产品sku 并获取产品属性。

    $product = Mage::getSingleton('core/session')->setCurrActiveProduct($skuChild); 
    $product->getResource()->getAttribute('attribute_code')->getFrontend()->getValue($_product);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-02-22
      • 2011-09-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多