Magento 1.9 wrong currency symbol in order confirmation email cart - when paying with PayPal - formatPrice() Magento 1.9 wrong currency symbol in order confirmation email cart - when paying with PayPal - formatPrice() php php

Magento 1.9 wrong currency symbol in order confirmation email cart - when paying with PayPal - formatPrice()


In the confirmation email, there should be no call to $this->helper('checkout')->formatPrice(...) anywhere. If this is the case, the order email uses the checkout item templates instead of its own, which is probably caused by a not fully implemented custom product type or a bug in your theme.

The order totals show the right currency because the totals block uses the formatPrice() method of the order, which takes the currency of the order into account:

$this->getOrder()->formatPrice($total->getValue());

The templates for the single items also use $_order->formatPrice(...). But depending on the product type, different templates are used. This is the default template.

The blocks and templates for each product type are defined in sales.xml with the addItemRender action:

<sales_email_order_items>    <block type="sales/order_email_items" name="items" template="email/order/items.phtml">        <action method="addItemRender"><type>default</type><block>sales/order_email_items_order_default</block><template>email/order/items/order/default.phtml</template></action>        <action method="addItemRender"><type>grouped</type><block>sales/order_email_items_order_grouped</block><template>email/order/items/order/default.phtml</template></action>        <block type="sales/order_totals" name="order_totals" template="sales/order/totals.phtml">            <action method="setLabelProperties"><value>colspan="3" align="right" style="padding:3px 9px"</value></action>            <action method="setValueProperties"><value>align="right" style="padding:3px 9px"</value></action>            <block type="tax/sales_order_tax" name="tax" template="tax/order/tax.phtml">                <action method="setIsPlaneMode"><value>1</value></action>            </block>        </block>    </block>    <block type="core/text_list" name="additional.product.info" /></sales_email_order_items>

Modules that add product types have to register their own renderers there, as it can be seen in bundle.xml:

<sales_email_order_items>    <reference name="items">        <action method="addItemRender"><type>bundle</type><block>bundle/sales_order_items_renderer</block><template>bundle/email/order/items/order/default.phtml</template></action>    </reference></sales_email_order_items>

If this was not defined, the default renderer is the one from the checkout, where the order model itself is not used, just the single items (which have no currency information attached). There the price formatting is done by the checkout helper which has no information about the order, so it uses the currently selected store currency.

Why is this only a problem with online payments like PayPal? Because with other methods, where the order confirmation mail is created immediately with the "place order" button, the currently selected store currency is still the same as the order currency. But in the callback request from PayPal this context is lost and the default currency will be used instead.

What you need to do?

  1. Search for the <sales_email_order_items> layout handle in your layout XML files to see if the default item renderers are registered correctly
  2. Make sure that any custom product types also register their renderers
  3. Check the templates that are used by the item renderers. Maybe it's a bug in your theme and you just have to replace $this->_helper('checkout')->formatPrice() with $_order->formatPrice().


This seems to be the charset currency error.You need to apply charset utf-8 by searching that particular code for email template.


You can change the currency symbols from System->Manage Currency->Symbols