- This topic has 16 replies, 3 voices, and was last updated 2 years, 11 months ago by
David.
-
AuthorPosts
-
June 27, 2019 at 3:00 am #942640
Sam
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
SamJune 27, 2019 at 3:19 am #942659Sam
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
June 27, 2019 at 6:02 am #942765David
StaffCustomer SupportGlad to hear you got it resolved and thanks for sharing the solution 🙂
August 25, 2021 at 1:06 am #1907635Sam
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
SamAugust 25, 2021 at 6:42 am #1907907David
StaffCustomer SupportNot easily as its currently baked in – but it is transtlatable – so try the gettext filter – see here:
August 25, 2021 at 6:58 am #1907924Sam
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
SamAugust 25, 2021 at 8:58 am #1908232David
StaffCustomer Supportthe 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
August 25, 2021 at 9:00 am #1908236Sam
Right, understood.
So how do I change the “basket” button?
thanks
August 25, 2021 at 9:23 am #1908268David
StaffCustomer SupportDo you mean the Basket Icon in the nav ? As that filter i provided should changes it Title.
August 25, 2021 at 9:53 am #1908309Sam
No, sorry I mean the #wc-mini-cart .button for the “Basket” button
August 26, 2021 at 4:41 am #1908918David
StaffCustomer SupportSorry 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?
August 26, 2021 at 5:31 am #1908962Sam
Sorry no I understood your solution for that. I was talking also about changing the “View Basket” button to “View Cart”.
thanks
August 26, 2021 at 6:21 am #1909023David
StaffCustomer SupportNow i am confused lol
So you want the View Basket to read View Cart ?
August 26, 2021 at 7:06 am #1909076Sam
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.
August 26, 2021 at 7:43 am #1909117David
StaffCustomer SupportYou 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_textTo
'View Basket' === $translated_textJust be mindful of the transients cache on Woo may need clearing to see those changes on the front end – see here:
-
AuthorPosts
- You must be logged in to reply to this topic.