0

I found product price which is showing on the single product page. And it's coming form default.phtml file inside Catalog/product/price/amount/default.phtml.

This code is using

<?php echo $block->getDisplayValue(); ?>

to display the price in that file.

Now i want to show this price in my product list page and when i am trying this code, show the product price. I am getting $0.00 ?

Can anyone tell me why this happening ?

1 Answer 1

0

Set the following code in your Magento_Catalog/templates/product/list.phtml

<?php echo $block->getProductPrice($_product) ?> 

I hope that was what you mean.

4
  • in access if i want to show this price based on cart rule..so can you please tell me the way to do that.... Commented Sep 16, 2016 at 10:56
  • What do you mean with based on cart rule? Commented Sep 16, 2016 at 12:45
  • I mean i have applied cart rule (discount on product price if any bulk purchase) in the product. so is there any way to get the expected prices like (buy 1-10 balls and the price would be $3/ball , buy 11 -30 balls and the price would be $2.7/ball ) and so on..that is the thing that i want to show on the product list page. can we do this as like we have the price using above code which you suggest to me.... Commented Sep 16, 2016 at 12:54
  • Im sorry, im verry late! You can do this with a custom function. Commented Nov 18, 2016 at 13:31

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.