首页 文章

Magento - 在订单确认电子邮件中显示产品属性

提问于
浏览
0

我需要以下方面的帮助:

在Magento,我创建了一个可配置的产品,并为其分配了一些简单的产品 . 它们具有单独的属性集,其中包含我创建的各个属性 .

在订单审核页面上,显示产品名称和选项 - 这很好 .

在订单确认电子邮件中,仅显示产品的名称和关联/订购产品的SKU . 我还需要显示属于我的产品的属性(我创建的属性,用于描述特定产品,如长度,宽度等) .

任何帮助表示赞赏!谢谢!

2 回答

  • 0

    您必须自定义订单确认电子邮件功能sendNewOrderEmail()的代码 .

    Get attributes of a ordered products and  pass this to email template .
    
  • 0

    我知道这是一个老问题,但这是我必须做的 .

    // get array of super_attributes
    $productOptions = $_item->getProductOptions();
    $superAttributes = $productOptions['info_buyRequest']['super_attribute'];
    
    // once you have super_attributes, loop through and load attribute information and output
    foreach($superAttributes as $attribute => $option) {
        $product = Mage::getModel('catalog/product')->setStoreId($_storeId)->setData($attribute,$option);
        $option = $product->getAttributeText($attribute);
    
       echo $option;
    }
    

    现在将输出属性的选项值 .

相关问题