当前位置: 动力学知识库 > 问答 > 编程问答 >

php - Sales email with promotional code - insert promotional code title

问题描述:

I have figured out how to remove the promotional code in the sales order emails via what was said here: Magento remove promotional code in customer transactional emails

Now they want the title of the promotion to be included in the email (but not the code). How can I go about this? Is there a variable I can add to mytotals.phtml?

网友答案:

Based on the available information, it appears that you want to pull the title of the promotion instead of the code. In mytotals.phtml you could get the information with this:

if ($_code=="discount") {
  $code_used = trim(str_replace(array("Discount (",")"),array(""),$this->escapeHtml($_total->getLabel())));
  $coupon = Mage::getModel('salesrule/coupon');
  $coupon->load($code_used, 'code');
  $rule = Mage::getModel('salesrule/rule')->load($coupon->getRuleId());
  $rule_name = $rule->getName();
}

You can echo $rule_name where you want the title of the Shopping Cart Rule to be displayed.

分享给朋友:
您可能感兴趣的文章:
随机阅读: