Store the original price for an order item
A new optional field, originalAmount, is now available in order entries. The new field allows merchants to store the original price of an item. You can store the originalAmount separately from the unitPrice, which is the currently effective price of an item.
Add the original price to email templates
To display the originalAmount in emails to your customers, you can edit the order confirmation email templates. To do so, replace this section of code:
<span style="padding-bottom: 10px;">#e(${d.order.currency}) #format_amount(${entry.unitPrice})<br/>
With this code:
#if($!{entry.originalAmount} != $!{entry.unitPrice})
<span style="padding-bottom: 10px; font-weight:bold; text-decoration: line-through">
#e(${d.order.currency}) #format_amount(${entry.originalAmount})</span>
<span style="padding-bottom: 10px; font-weight:bold; color:#ff1616">
#e(${d.order.currency}) #format_amount(${entry.unitPrice})
</span><br/>
#else
<span style="padding-bottom: 10px;">
#e(${d.order.currency}) #format_amount(${entry.unitPrice})
</span><br/>
#end
If you find any information that is unclear or incorrect, please let us know so that we can improve the Dev Portal content.
Use our private help channel. Receive updates over email and contact our specialists directly.
If you need more information about this topic, visit hybris Experts to post your own question and interact with our community and experts.