- Posts: 29
- Thank you received: 0
Replace discount display with text
12 years 10 months ago #134009
by Tahiera
Replace discount display with text was created by Tahiera
For the page that displays all the products, how can I make this change to discount prices:
Now it says:
$-1.50 $3.50 each
I want it to say:
SALE! $3.50 each
So have 'SALE!' text instead of the discount amount. I'm looking in product / listing_.php in the back end, but I'm not sure what exactly to change, or if that's the correct view. (It's for Hikashop Business.)
Now it says:
$-1.50 $3.50 each
I want it to say:
SALE! $3.50 each
So have 'SALE!' text instead of the discount amount. I'm looking in product / listing_.php in the back end, but I'm not sure what exactly to change, or if that's the correct view. (It's for Hikashop Business.)
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 12953
- Thank you received: 1778
12 years 10 months ago #134023
by Mohamed Thelji
Replied by Mohamed Thelji on topic Replace discount display with text
Hi,
If you want your price to be displayed this way, you should probably :
1. Set the "Show discounted price" option of the page "Hikashop->System->Configuration->Display" to NO.
2. Edit your translation file through "Hikashop->System->Configuration->Language->YourLanguageFile" and change this line :
By :
If you want your price to be displayed this way, you should probably :
1. Set the "Show discounted price" option of the page "Hikashop->System->Configuration->Display" to NO.
2. Edit your translation file through "Hikashop->System->Configuration->Language->YourLanguageFile" and change this line :
Code:
PRICE_BEGINNING=""
Code:
PRICE_BEGINNING="SALE! "
Please Log in or Create an account to join the conversation.
12 years 10 months ago #134030
by Tahiera
Replied by Tahiera on topic Replace discount display with text
Thanks! This seems to add 'SALE!' to all prices though, whether or not the item is on sale. Is it possible to add it only to sale items?
Please Log in or Create an account to join the conversation.
12 years 10 months ago #134131
by Xavier
Replied by Xavier on topic Replace discount display with text
Hi,
You will have to edit the view "product / listing_price" via the menu Display > Views and in the discount part replace:
By:
Then in the translation file add the following line in the override part:
In the "Show discounted price" option, select "Display the discount amount".
You will have to edit the view "product / listing_price" via the menu Display > Views and in the discount part replace:
Code:
echo '<span class="hikashop_product_discount">'.JText::_('PRICE_DISCOUNT_START');
if(bccomp($this->row->discount->discount_flat_amount,0,5)!==0){
echo $this->currencyHelper->format(-1*$this->row->discount->discount_flat_amount,$price->price_currency_id);
}elseif(bccomp($this->row->discount->discount_percent_amount,0,5)!==0){
echo -1*$this->row->discount->discount_percent_amount.'%';
}
echo JText::_('PRICE_DISCOUNT_END').'</span>';
Code:
echo '<span class="hikashop_product_discount">'.JText::_('PRICE_DISCOUNT_START');
if(bccomp($this->row->discount->discount_flat_amount,0,5)!==0){
//echo $this->currencyHelper->format(-1*$this->row->discount->discount_flat_amount,$price->price_currency_id);
}elseif(bccomp($this->row->discount->discount_percent_amount,0,5)!==0){
//echo -1*$this->row->discount->discount_percent_amount.'%';
}
echo JText::_('PRICE_DISCOUNT_END').'</span>';
Then in the translation file add the following line in the override part:
PRICE_DISCOUNT_START="SALE! "
In the "Show discounted price" option, select "Display the discount amount".
Please Log in or Create an account to join the conversation.
Time to create page: 0.209 seconds