Product Listing Text

  • Posts: 46
  • Thank you received: 1
12 years 1 month ago #68000

Hi

When i view all products on a page it says the price then the word "each" ($30 Each)

However when i go to a product view i would like the word to say "per bundle" as i have set a varient of 6 or 12 so the price shown is actually per bundle

So on the product page it says as $30 Each
Then when viewing the product it says $180 Per Bundle

I have added 'per bundle' to the language file but not sure on what to do next

Thanks

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

  • Posts: 2334
  • Thank you received: 403
12 years 1 month ago #68012

Hi there,

I think the best way for you to get what you want is to edit the translation of the word EACH in the language file. Just replace it with "per bundle" and it should for works fine. However this may not be the best solution if you want to display "each" somewhere in your website. in this case, tell me which product listing layout you are using and I'll help you to display what you want :)

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

  • Posts: 46
  • Thank you received: 1
12 years 1 month ago #68022

Hi Eliot

Yes I did that in the language file.

I am using the default product listing with the green css style

Thanks

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

  • Posts: 2334
  • Thank you received: 403
12 years 1 month ago #68023

Translation didn't worked?
It's definitely the best way since it avoid any hard modification in the code...
Are you sure you changer the translation for PER_UNIT keyword? And you're using the right file?

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

  • Posts: 46
  • Thank you received: 1
12 years 1 month ago #68027

Yes i'm sure as the wording changed on both the product listing page and the page showing all products in the category

I only need to change the per_unit wording on the product listing page

Thanks

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

  • Posts: 2334
  • Thank you received: 403
12 years 1 month ago #68029

Oh, ok.

In this case you have to add a new translation to the language file.
Just replace what you did by the old translation (per_unit="each") and add a new one (for example PER_BUNDLE="per bundle").
Then you have to edit the view (Display>View, find the listing_price view for product) and replace this line:

echo JText::_('PER_UNIT');

with this one:
echo JText::_('PER_BUNDLE');

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

  • Posts: 46
  • Thank you received: 1
12 years 1 month ago #68030

Awesome thank you :-)

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

  • Posts: 46
  • Thank you received: 1
12 years 1 month ago #68032

oh that did not work it changed the wording yes but also on the category page as well that shows all the products. On that page i still need it to show Each but when viewing a product it should show Per bundle

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

  • Posts: 2334
  • Thank you received: 403
12 years 1 month ago #68035

Hum sorry, I didn't get it. Here is what you have to do, replace the line I gave you before by this code:

if($_REQUEST['task']=='show'){
	echo JText::_('PER_BUNDLE');
}else{
	echo JText::_('PER_UNIT');
}

The first case is the translation in the product page and the second case is for product listing.
You should be able to do what you want now :)

Last edit: 12 years 1 month ago by Eliot.

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

  • Posts: 46
  • Thank you received: 1
12 years 1 month ago #68036

Yes that worked.

Thanks you Eliot great service as always :)

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

Time to create page: 0.085 seconds
Powered by Kunena Forum