0

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.

enter image description here

4
  • For add the actual price you need to add the special price variable in the file, where your pdf generation file is. Jan 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 Zaki
    Jan 4, 2017 at 5:00
  • You need to query and get it from the database table where product actual price is stored. Jan 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 Zaki
    Jan 4, 2017 at 5:16

3 Answers 3

1

You could try using $_item->getProduct()->getPrice() to get the original price.

 <?php echo $this->helper('checkout')->formatPrice($_item->getProduct()-‌​>getPrice()) ?>
2
  • Tried that one. But it come with "Fatal error: Uncaught Error: Call to a member function getProduct() on null".
    – Ali Zaki
    Jan 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
    – Richard
    Jan 4, 2017 at 14:18
0

You should lookup in app/design/frontend/(theme_name)/default/template/email/orde‌​r/items/invoice/defa‌​ult.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
5
  • 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 Zaki
    Jan 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.ph‌​p 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 Zaki
    Jan 4, 2017 at 6:35
  • ok finally Try This one : ` $orderItem->getBasePriceInclTax();` Jan 4, 2017 at 6:41
  • Same result sir. Again showing 9988. Now what?
    – Ali Zaki
    Jan 4, 2017 at 6:44
0
<?php $this->helper('checkout')->formatPrice($_item->getProduct()->getData('price')); ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.