Replace discount display with text

  • Posts: 29
  • Thank you received: 0
10 years 11 months ago #134009

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.)

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

  • Posts: 12953
  • Thank you received: 1778
10 years 11 months ago #134023

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 :

PRICE_BEGINNING=""
By :
PRICE_BEGINNING="SALE! "

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

  • Posts: 29
  • Thank you received: 0
10 years 11 months ago #134030

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.

  • Posts: 13201
  • Thank you received: 2322
10 years 11 months ago #134131

Hi,

You will have to edit the view "product / listing_price" via the menu Display > Views and in the discount part replace:

					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>';
By:
					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.071 seconds
Powered by Kunena Forum