Plugin Contributor
Ewout
(@pomegranate)
Hello,
Just to avoid confusion, are you talking about the ‘regular price’ (for a product on sale) or about the price before a discount (coupon) is applied? The regular price is not stored in the order and if you don’t want to use the premium templates, you’ll have to load the product object first and use that to retrieve the regular price. For the pre-discount single price you can use $item['single_line_total'].
Happy New Year!
Ewout
Thread Starter
tpark
(@tpark)
Hi dear @pomegranate,
Happy new year
here is my code:
<?php echo $item['price']; ?><!-- single item Original price (before applying any coupon code or sale/discounts) |not-working|-->
<?php echo $item['single_line_total']; ?><!--single item Sale price |Working| -->
<?php echo $item['line_total']; ?><!-- sale total |Working| -->
Plugin Contributor
Ewout
(@pomegranate)
$item['price'] is the total price (single price * qty), before discount, including tax. As I wrote in the post above, WooCommerce does not store ‘regular’ prices in the order (or the cart for that matter), only when a discount is applied there is a difference between the before and after discount price. Sale prices are not considered as discounts by WooCommerce and therefor also not stored in the order. You will need to get this information from the product (and then copy it to the order, because product prices can change and the order should not).
If you need more help with this, I recommend finding a programmer that knows WooCommerce or getting the Premium Templates extension (which requires no programming and comes with additional support when required).
Ewout