Skip Navigation

[Resolved] WC “Add to cart” text does not change with Views shortcode

This thread is resolved. Here is a description of the problem and solution.

Problem:

I'm using the shortcode [wpv-woo-buy-or-select add_to_cart_text='TEST' link_to_product_text='TEST' show_variation_options="yes" group_add_to_cart_text="TEST"] inside a Views and I'm still have the standard WC "Add to cart" text.

Solution:

In the product listing page, for the variation product posts, the shortcode [wpv-woo-buy-or-select] is designed to display a "Select options" button, just like Woocommerce shop page by default(without shortcode [wpv-woo-buy-or-select]).

And you can customize text "Select options" by attribute "link_to_product_text", for example:

[wpv-woo-buy-or-select add_to_cart_text="Add to basket" link_to_product_text="TEST"]

Relevant Documentation:

https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-woo-buy-or-select

This support ticket is created 5 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Tagged: 

This topic contains 6 replies, has 2 voices.

Last updated by Pat 5 years, 10 months ago.

Assisted by: Luo Yang.

Author
Posts
#1217119

Pat

Hello,

I'm using the shortcode [wpv-woo-buy-or-select add_to_cart_text='TEST' link_to_product_text='TEST' show_variation_options="yes" group_add_to_cart_text="TEST"] inside a Views and I'm still have the standard WC "Add to cart" text.

Any reason for this?
Let me know
Thanks
Pat

#1217390

Dear Pat,

The shortcode [wpv-woo-buy-or-select] works in the the product listing page, for example shop page, see our document:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-woo-buy-or-select

If it is single product post(Product detail pages), please try another shortcode [wpv-woo-buy-options], for example:
[wpv-woo-buy-options add_to_cart_text="TEST"]

See document:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-woo-buy-options

#1217394

Pat

Hi Luo,

Thanks for taking care.
I'm using this shortcode inside the product listing page currently and I'm getting this issue !!!
As you can see from the below code, I want users to be able to select the right variation, have the price updated dynamically, have give them the ability to put it in the cart thanks to the button "Add to cart"
But then, even if I have placed "TEST" as the text to display, I'm still having "Add to cart" !!!

[wpv-woo-product-image size="medium"]
[wpv-post-link]
[wpv-woo-products-rating-listing]
[wpv-woo-buy-or-select add_to_cart_text='TEST' link_to_product_text='TEST' show_variation_options="yes" group_add_to_cart_text="TEST"]

Regards
Pat

#1217396

In the product listing page, for the variation product posts, the shortcode [wpv-woo-buy-or-select] is designed to display a "Select options" button, just like Woocommerce shop page by default(without shortcode [wpv-woo-buy-or-select]).

And you can customize text "Select options" by attribute "link_to_product_text", for example:
[wpv-woo-buy-or-select add_to_cart_text="Add to basket" link_to_product_text="TEST"]

See the document I mentioned above:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-woo-buy-or-select
Please note that if you are setting the show_variation_options=”yes”, it won’t use the customized Add to cart text set in the link_to_product_text attribute. This is because it is only meant to be used if the show_variation_options is set to “no”.

#1217926

Pat

Hi Luo,

Thanks for this clarification. I have just placed the [wpv-woo-buy-or-select add_to_cart_text=" PANIER" link_to_product_text="PANIER" show_variation_options="yes"] and it's now working (don't know why it was not before ?).

Anyway, I need to place an icon before the TEST text.
How can I add something like <span class="glyphicon glyphicon-search" aria-hidden="true">
I tried to place it near the Add to cart" text but it's not working.

Regards
Pat

New threads created by Luo Yang and linked to this one are listed below:

https://toolset.com/forums/topic/i-need-to-place-an-icon-before-the-test-text/

#1218515

For the new question, please check the new thread here:
https://toolset.com/forums/topic/i-need-to-place-an-icon-before-the-test-text/

#1218538

Pat

Hi Luo,
Everything is fine now.
Thanks
Pat