Change of text after price

  • Posts: 50
  • Thank you received: 1
11 years 4 months ago #153814

-- url of the page with the problem -- :http://www.billbo.co.uk/index.php/ribbons-stickers/satin-ribbon/ribbons
-- HikaShop version -- : 2.3 Business
-- Joomla version -- : 2.5.16
-- PHP version -- : 5.3.28

Hi,

I want to change the text that displays after the price for only some of the products. see web page
www.billbo.co.uk/index.php/ribbons-stick...satin-ribbon/ribbons
We sell this product in 100m rolls and want the price to reflect this. All other products are ok as the default setting.

Current display:

£ 20.00 each
£ 17.50 per unit for buying at least 5
£ 15.00 per unit for buying at least 10
£ 12.50 per unit for buying at least 50
£ 10.00 per unit for buying at least 100

New display:

£ 20.00 per 100m roll
£ 17.50 per 100m roll buying at least 5 rolls
£ 15.00 per 100m roll buying at least 10 rolls
£ 12.50 per 100m roll buying at least 50 rolls
£ 10.00 per 100m roll buying at least 100 rolls

Thanks in advance.

Paul

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

  • Posts: 12953
  • Thank you received: 1778
11 years 4 months ago #153815

Hello Paul,
Note that you'll be able to do that by editing your translation file .

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

  • Posts: 50
  • Thank you received: 1
11 years 4 months ago #154087

Hi Mohamed,

I already have a mod for that string. Is there a way to have different text for different products. If you look at the two products I have attached, product 1 is sold as 100m rolls and product 2 is sold in units and is ok as it is.

1 www.billbo.co.uk/index.php/ribbons-stick...satin-ribbon/ribbons
This is what it should be £x.xx per 100m roll if buying at least

2 www.billbo.co.uk/index.php/bears/premier...tion/25cm-cocoa-bear

Thanks

Paul

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

  • Posts: 13201
  • Thank you received: 2322
11 years 4 months ago #154100

Hi,

So you will have to edit the view "product / listing_price" and depending on the product id or product category id you have to display one word or another one, ex:

				if($price->price_min_quantity>1){
					echo '<span class="hikashop_product_price_per_unit_x">'.JText::sprintf('PER_UNIT_AT_LEAST_X_BOUGHT',$price->price_min_quantity).'</span>';
				}else{
					echo '<span class="hikashop_product_price_per_unit">'.JText::_('PER_UNIT').'</span>';
				}
Will become:
if($this->row->product_id == 'XX'){
				if($price->price_min_quantity>1){
					echo '<span class="hikashop_product_price_per_unit_x">'.JText::sprintf('PER_UNIT_AT_LEAST_X_BOUGHT_METER',$price->price_min_quantity).'</span>';
				}else{
					echo '<span class="hikashop_product_price_per_unit">'.JText::_('PER_UNIT_METER').'</span>';
				}
}else{
				if($price->price_min_quantity>1){
					echo '<span class="hikashop_product_price_per_unit_x">'.JText::sprintf('PER_UNIT_AT_LEAST_X_BOUGHT',$price->price_min_quantity).'</span>';
				}else{
					echo '<span class="hikashop_product_price_per_unit">'.JText::_('PER_UNIT').'</span>';
				}
}
Then translations will be:

PER_UNIT_AT_LEAST_X_BOUGHT_METER="per 100m roll buying at least %s rolls"
PER_UNIT_METER="per 100m roll"
PER_UNIT_AT_LEAST_X_BOUGHT="PER_UNIT_AT_LEAST_X_BOUGHT=" per unit for buying at least %s"
PER_UNIT="each"

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

  • Posts: 50
  • Thank you received: 1
11 years 4 months ago #154197

Hi Xavier,

I have made the changes detailed below ( to the template in use ) but nothing seems to have changed.

I have taken screen shots of the files I have changed for you to verify that I have changed the correct files.

Thanks

Paul

Attachments:

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

  • Posts: 84292
  • Thank you received: 13692
  • MODERATOR
11 years 4 months ago #154202

Hi,

Of course, you need to replace XX in the first line by the id of the product for which you want to do the change. If you leave XX, it won't match with any product id and you won't see the difference.

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

Time to create page: 0.085 seconds
Powered by Kunena Forum