2013-12-22 58 views
2

我想在Magento的购物车和发票中显示两种货币。我已通过此代码在产品页面中填写如何在magento购物车中显示两种货币

<div class="currency"> 
<?php if(Mage::app()->getStore()->getCurrentCurrencyCode() == 'USD'): ?> 
<span class="price">(<?php echo round(Mage::helper('directory')->currencyConvert($_product->getFinalPrice(), 'USD', 'AUD'), 2); ?>) AUD</span> 
<?php else: ?> 
<span class="price">(<?php echo round(Mage::helper('di`enter code here`rectory')->currencyConvert($_product->getFinalPrice(), 'AUD', 'USD'), 2); ?>) USD</span> 
<?php endif; ?> 
</div> 

现在我想在电子邮件发票中显示此内容。

在电子邮件模板TI

回答

0

有这条线

{{layout handle="sales_email_order_items" order=$order}} 

仰视销售布局,我们从那里你可以找到应用程序\设计\前端[包装] [主题] \布局\ sales.xml

请参阅用于呈现电子邮件的项目部分的.phtml文件,编辑您需要的项目,请记住这些也在前端使用。

,如果你想在一个.phtml文件分开,使前端和电子邮件模板可以使用不同的文件,复制/粘贴/在.xml文件重命名sales_email_order_items,改变template=零部件到新的模板,可以肯定的是,在你的电子邮件模板,你改变了上面提到的句柄到你改名的布局,否则它会使用原来的。

你的代码应该可以正常工作,如果它不起作用并且$ _product可能不在模板中或者是另一个类,那么您可能只需更改$_product->getFinalPrice(),因为处理与sales_flat_order有关的集合而不是目录_产品

相关问题