Display discount

  • Posts: 59
  • Thank you received: 0
11 years 8 months ago #92687

How can i edit discount output in products listing? i need to display discount after product name. i know that i need to edit listing_img_title.php and listing_price.php files, but my php is not so good. can you tell me, hat i need to change?
Thank you.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 8 months ago #92822

Hi,

It depends of what you need to display, only the percentage of the discount, or the discounted price, or discounted + normal price ...

All of these values are in the variable: "$this->row->discount".
You can use this code just after the product name part of the view "listing_img_title".

if(isset($this->row->discount) && !empty($this->row->discount)){
    var_dump($this->row->discount); 
}

With the var_dump, you wsill see all the elements inside the variable, then you just have to display the desired one.

Please Log in or Create an account to join the conversation.

  • Posts: 59
  • Thank you received: 0
11 years 8 months ago #92839

oh, thank you! one nore question: how it is to display a discount time like countdown?

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
11 years 8 months ago #92920

I think that to do it you'll need to customize a little more your code by using some values of your $this->row->discount. Like Xavier said, you can use "var_dump" to select the good values to use.

Please Log in or Create an account to join the conversation.

Time to create page: 0.049 seconds
Powered by Kunena Forum