Skip Navigation

[Résolu] [wpv-woo-buy-options] has undocumented attributes

Ce fil est résolu. Voici une description du problème et la solution proposée.

Problem: The Plugin WooCommerce Subscriptions, which we recommend in our tutorials for Membership Sites, registers 2 new Product Types: “subscriptions” and “variable-subscriptions”. These are technically “taxonomy terms”, in WooCommerce.

These Product Types will not work nicely with WooCommerce Views when you insert the “wpv-woo-buy-or-select” shortcode with “show_variation_options” set to “true”.

The issue is that it will not allow you to select any variations and you cannot add the product to the cart.


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.

This topic contains 1 réponse, has 2 voix.

Last updated by Beda Il y a 3 années et 9 mois.

Assigned support staff: Beda.


Link to documentation page:

I found this support thread: as I also had the same problem with the front end presentation of Woocommerce Variable Subscription products. In this thread Beda presents a solution using the [wpv-woo-buy-options] shortcode with several attributes:

add_to_cart_text="add to cart"

These attributes are currently not documented on the page while they are essential for the solution Beda offers. I can confirm I tried this solution and it works with the Toolset Starter theme, Woocommerce Views and the Woocommerce Subscription plugin to show a dropdown with the Subscription Variations on a single product page.

I would like to have a complete reference of all the attributes we can use with the various Views shortcodes. In this case it seems to me the documentation is incomplete. I would like to know the meaning and possibilities of the attributes Beda uses in his example code.


There seems to be some misunderstanding.

There are 2 ShortCodes, one for the Product Listing Pages and one for Single Products.
The one you refer to is [wpv-woo-buy-options] and supports exactly one attribute:
It Displays 'add to cart' or 'select options' box for single product pages.

In the code this is as well visible in the wpv_woo_buy_options_func() function in Toolset WooCommerce Views in the file Class_WooCommerce_Views.php.

The other ShortCode [wpv-woo-buy-or-select] is created with wpv_woo_buy_or_select_func() in the same file and has all the attributes you mention.
It is used in loops instead of single posts.

The ShortCode there is wrong.

This are the right steps:

1. Install WooCommerce Subscriptions and a full Toolset WooCommerce Setup
2. Create a Variable Product as per WooCommerce native features
3. Create a Variable Subscriptions product
4. Create a Content Template for them and insert:
[wpv-woo-buy-options add_to_cart_text="Add to cart"]
5. You will see the Variations picker on the single products
6. Create an archive for the shop, and add this to the Loop:
[wpv-woo-buy-or-select show_variation_options="yes"]
7. Since the bug was not yet fixed, this last #6 now should show the same as the single product page, but does not:

Please await the fix in that erratum, or via update.

Thank you!