Different button text per category

  • Posts: 40
  • Thank you received: 0
11 years 7 months ago #131992

Hi,

I need to change the text for the add to cart button depending on the category that is being displayed in a listing page.

The main issue that I'm having is when a product has options. I've been able to do something similar in the table layout by creating a language override within joomla, then checking the category id against an array of IDs for which to change the text, but can't work out how to do something similar in the DIV layout.

Thanks in advance

Keith

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

  • Posts: 13201
  • Thank you received: 2322
11 years 7 months ago #132059

Hi,

You will have to edit the view "product / quantity" and get the current category id, then depending on the category id you will have to change the translation key in the JText::('xxxxxxxx') code.

It require some php skills.

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

  • Posts: 40
  • Thank you received: 0
11 years 7 months ago #132062

Hi Xavier,

that's fine, exactly what I did for the table heading in the listing_table file, I just wasn't sure if that technique would work in the quantity file :)

What was confusing me was that the ADD_TO_CART text value seems to change depending on whether the product has options, but I couldn't see where within the quantity file.

Thanks

Keith

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

  • Posts: 83995
  • Thank you received: 13605
  • MODERATOR
11 years 7 months ago #132119

It's the check at the beginning of the quantity file of the product view which display the "choose option" button instead of the "add to cart" when the product has characteristics/options/custom item fields to be filled on the product page.

The following user(s) said Thank You: simonbornhoft

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

  • Posts: 40
  • Thank you received: 0
11 years 7 months ago #132125

Ah! Perfect! Many thanks :)

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

  • Posts: 40
  • Thank you received: 0
11 years 7 months ago #132127

Just to say, that all worked perfectly, many thanks Xavier

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

Time to create page: 0.071 seconds
Powered by Kunena Forum