Woocommerce add to basket add to cart confusing terminology

len
138 Posts
len posted this 24 April 2016

In Themler Product template the buttons say "Add to Cart". In Wordpress the buttons on the product category page says "Add to Basket".
The page is "cart" in Wordpress, the link is "Cart" on the top menu
On the Cart page, under the grid, the update button says "Update Basket", the totals box header says "Basket Totals".

How do I change the text on these buttons to Cart from Basket?

Thanks
LenW

In Themler Product template the buttons say "Add to Cart". In Wordpress the buttons on the product category page says "Add to Basket". The page is "cart" in Wordpress, the link is "Cart" on the top menu On the Cart page, under the grid, the update button says "Update Basket", the totals box header says "Basket Totals". How do I change the text on these buttons to Cart from Basket? Thanks LenW
Vote to pay developers attention to this features or issue.
8 Comments
Order By: Standard | Newest
Support Team
Support Team posted this 27 April 2016

Hi,

Looks like "cart" word has been translated to "basket" by localization file you're using.
On my side I see only "cart".

It would be better to adjust translation file and change "basket" to "cart" if possible.

Thank you,
Olivia

Hi, Looks like "cart" word has been translated to "basket" by localization file you're using. On my side I see only "cart". It would be better to adjust translation file and change "basket" to "cart" if possible. Thank you, Olivia
len
138 Posts
len posted this 13 July 2016

How do I do that please, where do I find the localisation file and will it be over-written when if I have to amend the theme and re-export.
LenW

How do I do that please, where do I find the localisation file and will it be over-written when if I have to amend the theme and re-export. LenW
Support Team
Support Team posted this 14 July 2016

Hello Len,
in general the woocommrce related translations are stored in the file

<path_WP_folder>\wp-content\plugins\woocommerce\i18n\languages\woocommerce.pot 

Please check it

regards,
Aileen

Hello Len, in general the woocommrce related translations are stored in the file <path_WP_folder>\wp-content\plugins\woocommerce\i18n\languages\woocommerce.pot Please check it regards, Aileen
len
138 Posts
len posted this 13 December 2016

Aileen

I gave up on this in July, but it is still an issue. In the localisation file I cannot find the mapping you refer to.

In Wordpress I have renamed all I can change to "Basket", but the "Cart Link Menu" has the basket icon, and the word "Cart" which links to the "/basket/" page. This has to be a programming error in Themler: Link text and link are not the same.

I have also tried to change it all the other way to "Cart", but buttons on products are "Add to Basket", which cannot easily be changed (other than direct edit of theme / Wordpress files). So this is not a viable solution either.

What I want to do is change the Cart Link without changing any file that will get overwritten by a theme or Wordpress update, and also not use a Child theme.

This IS a core fault in themler, can you please pass it onto your programmers for URGENT resolution.

Any sensible suggestions of help appreciated.

Aileen I gave up on this in July, but it is still an issue. In the localisation file I cannot find the mapping you refer to. In Wordpress I have renamed all I can change to "Basket", but the "Cart Link Menu" has the basket icon, and the word "Cart" which links to the "/basket/" page. This has to be a programming error in Themler: Link text and link are not the same. I have also tried to change it all the other way to "Cart", but buttons on products are "Add to Basket", which cannot easily be changed (other than direct edit of theme / Wordpress files). So this is not a viable solution either. What I want to do is change the Cart Link without changing any file that will get overwritten by a theme or Wordpress update, and also not use a Child theme. This IS a core fault in themler, can you please pass it onto your programmers for URGENT resolution. Any sensible suggestions of help appreciated.
Support Team
Support Team posted this 15 December 2016

Hello Len,
the "Cart" text on the Cart Link control is not hardcoded, the translation for "cart" word is used. Here is relevant code:

                       <span>


                                <?php if ($cartSize): ?>
                                    <?php echo sprintf(__('Cart (%s)', 'default'), $cartSize) ?>
                                <?php else: ?>
                                    <?php echo __('Cart', 'default') ?>
                                <?php endif ?>
                        </span>

So if you want to output different text here you need to change the relevamt translation text.

regards,
Aileen

Hello Len, the "Cart" text on the Cart Link control is not hardcoded, the translation for "cart" word is used. Here is relevant code: <span> <?php if ($cartSize): ?> <?php echo sprintf(__('Cart (%s)', 'default'), $cartSize) ?> <?php else: ?> <?php echo __('Cart', 'default') ?> <?php endif ?> </span> So if you want to output different text here you need to change the relevamt translation text. regards, Aileen
len
138 Posts
len posted this 16 December 2016

Aileen

When I looked I could not find the translation text in the woocommerce.pot file, I will have another look.

I still maintain that we should not need to be doing this, setting such text should be a function of Themler.

LenW

Aileen When I looked I could not find the translation text in the woocommerce.pot file, I will have another look. I still maintain that we should not need to be doing this, setting such text should be a function of Themler. LenW
Support Team
Support Team posted this 20 December 2016

Hi,

Not exactly. All theme needs to do is to provide specific text wrapped in translation function. In this case the text will be translated if appropriate translation kep exists in WP translation file.
In the example above keys Cart (%s) and Cart are two different translation keys. For example, if there is no translation key for exactly Cart (%s) it will not be translated. In this case you just need to add appropriate key to .po file and regenerate .mo file. There are a lot of instructions and tools for this.

Thank you,
Themler Team

Hi, Not exactly. All theme needs to do is to provide specific text wrapped in translation function. In this case the text will be translated if appropriate translation kep exists in WP translation file. In the example above keys `Cart (%s)` and `Cart` are two different translation keys. For example, if there is no translation key for exactly `Cart (%s)` it will not be translated. In this case you just need to add appropriate key to .po file and regenerate .mo file. There are a lot of instructions and tools for this. Thank you, Themler Team
edwardterrya7725
21 Posts
edwardterrya7725 posted this 11 September 2024

If I need to change the theme and re-export, where can I find the localization file and will it be overwritten?

.
.
concrete layers near me

If I need to change the theme and re-export, where can I find the localization file and will it be overwritten? . . [concrete layers near me][1] [1]: https://www.aucklandconcretedriveways.co.nz/
You must log in or register to leave comments