Changing the add to cart text

  • Posts: 49
  • Thank you received: 6
  • Hikashop Business
2 weeks 6 days ago #369619

-- HikaShop version -- : 5.1.6
-- Joomla version -- : 5.3.1
-- PHP version -- : 8.2
-- Browser(s) name and version -- : firefox

Hello,
I would like to know how to change the "add to cart" text depending on the product or category as I'm selling products but also seats for a workshop on my website. So I'd like to have "Reserve your spot" appearing rather than "add to the cart" for the workshop. Is there an easy way to do that?
Thank you!

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

  • Posts: 84861
  • Thank you received: 13817
  • MODERATOR
2 weeks 6 days ago #369621

Hi,

You can do that purely via a translation override in HikaShop. Just go in the back-office:

1. In Joomla admin, go to Components → HikaShop → Configuration → Languages.
2. Click the edit icon for your current language. In the editor, copy the line with the key for “Add to cart” (probably `ADD_TO_CART`) into the override textarea.
3. Change the translation on the right-hand side to your preferred wording (for example, “Reserve your spot”) and save.

This way, your custom text will persist across updates.
For more details, see the “How to modify translations” documentation :
www.hikashop.com/download/languages.html#modify

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

  • Posts: 49
  • Thank you received: 6
  • Hikashop Business
2 weeks 6 days ago #369627

Thank you Nicolas for your answer, but what I meant is that I have various categories (original artworks, fine art prints and events). For some categories (original artworks and fine art prints) the "add to cart" text is what I need. However, I would like to change the text that appears for products in the events category. So, some of my products would have the "add to cart" text and some will have the "reserve your spot" text.

I think that what you are suggesting I do in your answer will change the text for all products which is not what I want.

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

  • Posts: 84861
  • Thank you received: 13817
  • MODERATOR
2 weeks 5 days ago #369628

Hi,

Indeed.
In that case, you want to create a custom field of the table "product" with the column name "product_addtocart_message".
You could have it of the type "text", and enter the text you want in each product, for the ones that need another text than the default one.
Or you could have a "radio" or "single dropdown" type, with the values being the different texts for the button. Then, in each product, you can select the value you want.

The following user(s) said Thank You: Noe

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

  • Posts: 49
  • Thank you received: 6
  • Hikashop Business
2 weeks 5 days ago #369631

Thank you Nicolas! This works perfectly!

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

  • Posts: 49
  • Thank you received: 6
  • Hikashop Business
8 hours 32 minutes ago #369820

Hi Nicolas,

I'm trying to do the same thing with products that have variants, but it's not working in this case. How can I change the text for these products? I'd like to change the "choose options" text as well as the one that appears on the product page.

Thank you!

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

  • Posts: 84861
  • Thank you received: 13817
  • MODERATOR
5 hours 12 minutes ago #369821

Hi,

What do you mean by "it's not working in this case" ?
It should be the same for variants.
Edit each variant of the product, and enter the text you want in the product_addtocart_message custom field of each variant.

For the "choose options" button, if you want another text for all the products with variants, you can just create a translation override for the translation key CHOOSE_OPTIONS
And if you want different texts for different products for that button, you want to create a custom field of the table "product" with the column name "product_chooseoptions_message" and then you can enter the text you want in each product in that custom field, or leave blank to use the default text.

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

Time to create page: 0.065 seconds
Powered by Kunena Forum