Product Cheap special price is 9988, and it's actual price was 9999. i want to show actual price 9999 and discount price 9988 in the invoice. please help me. thank you.
-
For add the actual price you need to add the special price variable in the file, where your pdf generation file is.– Nitin PawarJan 4, 2017 at 4:57
-
File that is printing the prices of products on pdf has $item veriable. And i am unable to get special price/ actual price of product from $item. @NitinPawar– Ali ZakiJan 4, 2017 at 5:00
-
You need to query and get it from the database table where product actual price is stored.– Nitin PawarJan 4, 2017 at 5:09
-
Alright. THANK YOU @NitinPawar. can you please tell me table name or any thing else, that might help me do it more fast please.– Ali ZakiJan 4, 2017 at 5:16
3 Answers
You could try using $_item->getProduct()->getPrice()
to get the original price.
<?php echo $this->helper('checkout')->formatPrice($_item->getProduct()->getPrice()) ?>
-
Tried that one. But it come with "Fatal error: Uncaught Error: Call to a member function getProduct() on null".– Ali ZakiJan 4, 2017 at 7:23
-
Are you paying any attention to what you copy? Or the errors that you get? This answer said
$_item
, the other other said$item
if $_item is null, it won't have a member function called getProduct(). If you're using the link from 153099 to add it as an attribute you probably want to look into adding it into the sales_flat_order_item first, as the price attribute could change between the order being created and the invoice being created– RichardJan 4, 2017 at 14:18
You should lookup in app/design/frontend/(theme_name)/default/template/email/order/items/invoice/default.phtml There should be a section with item price - it varies depending of template you use. There you are able to put the code to display regular price.
getOriginalPrice()
getPrice()
getDiscountAmount
-
But sir i want to get original price in app/code/local/sales/model/order/pdf/item/invoice/default.php. kindly tell me what to do?– Ali ZakiJan 4, 2017 at 6:14
-
So for that I think you need to try this :
$item->getPrice()),
in app/code/local/sales/model/order/pdf/item/invoice/default.php Jan 4, 2017 at 6:26 -
I have already tried this one. This shows me the final price. That is 9988, and i want to get 9999.– Ali ZakiJan 4, 2017 at 6:35
-
ok finally Try This one : ` $orderItem->getBasePriceInclTax();` Jan 4, 2017 at 6:41
-
<?php $this->helper('checkout')->formatPrice($_item->getProduct()->getData('price')); ?>