Skip to main content

Different button text per category

More
12 years 10 months ago #131992 by simonbornhoft
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.

More
12 years 10 months ago #132059 by Xavier
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.

More
12 years 10 months ago #132062 by simonbornhoft
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.

More
12 years 10 months ago #132119 by nicolas
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.

More
12 years 10 months ago #132125 by simonbornhoft
Ah! Perfect! Many thanks :)

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

More
12 years 10 months ago #132127 by simonbornhoft
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.169 seconds
Powered by Kunena Forum