Skip to main content

Display discount

More
13 years 6 months ago #92687 by Dodesign
Display discount was created by Dodesign
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.

More
13 years 6 months ago #92822 by Xavier
Replied by Xavier on topic Display discount
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".
Code:
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.

More
13 years 6 months ago #92839 by Dodesign
Replied by Dodesign on topic Display discount
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.

More
13 years 6 months ago #92920 by Mohamed Thelji
Replied by Mohamed Thelji on topic Display discount
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.187 seconds
Powered by Kunena Forum