Archived topic
Cart vs Basket
16 replies · Started by Sam on June 27, 2019
Hi, I have noticed something strange I hope you can help me with...
It seems that in WC there are conflicting terms used for the cart/basket:
- The add to cart button says "Add To Basket"
- The mini cart menu has a button that says "View Basket"
However,
- Hovering over the cart icon in the menu says "view your shopping cart"
- The page title on the cart/basket page is "cart"
Is this a WC issue or something that is set in GP?
Is there any way to amend this so it is consistent?
Thanks
Sam
Hi, I solved the page title, it was as simple as changing the page title of the cart page... duh!
Any help with the other would be appreciated.
thanks
Glad to hear you got it resolved and thanks for sharing the solution :)
Hi Guys, circling back on this again. To summarise:
- on the cart page, Woo default is "cart" but you can change to "basket" simply by changing the page title.
- The add to cart button itself seems to say "Basket" by default but you can add a snippet or use a plugin to change this button on both archive or the product page.
- That leaves one last piece related to GeneratePress. The mini cart. This says "basket" but if you hover the cart icon in the menu it says "view your shipping cart" in the alt text on hover.
So in the end I stuck to Basket as it seemed the easiest to change. However, if I wanted to change to use "add to cart", how do I change the add to cart button in the mini cart dropdown and widget?
Thanks
Sam
Not easily as its currently baked in - but it is transtlatable - so try the gettext filter - see here:
Hi David, thanks so your solution here would be to use the gettext filter for both the button and the hover label?
That would be tricky as if it doesn't somehow target that button it would change every instance of the word "basket", no?
thanks
Sam
the gettext filter should apply to any text string that is translatable which the Title attribute of that button is ( which is what the browser uses to show the tooltip hover label ). And it will only apply to strings that 100% match, in the link i provided it looks for that entire text string
Right, understood.
So how do I change the "basket" button?
thanks
Do you mean the Basket Icon in the nav ? As that filter i provided should changes it Title.
No, sorry I mean the #wc-mini-cart .button for the "Basket" button
Sorry i am a little confused - this is what i see:
https://www.screencast.com/t/ajECY3nj7s
The tooltip is still Cart - is that what you mean?
Sorry no I understood your solution for that. I was talking also about changing the "View Basket" button to "View Cart".
thanks
Now i am confused lol
So you want the View Basket to read View Cart ?
Yes, sorry if that was not explained properly, I did try to explain both issues. That is the second issue I would like to address.
You would use the same gettext filter:
The function in that code is anonymous, so you can add it multiple times, just change the
'View your shopping cart' === $translated_text
To
'View Basket' === $translated_text
Just be mindful of the transients cache on Woo may need clearing to see those changes on the front end - see here: