Hello,
I'm currently working on an e-commerce site and face a strange situation.
I have created a product Views to display single product and have inserted the [wpv-woo-buy-options] shortcode.
I have found 2 situations where this shortcode does not return any price :
1. When used with a variable product with all variations having the same price.
2. When used with a single product
The first case can be treated with the following code inside the function.php :
function ssp_always_show_variation_prices($show, $parent, $variation) {
return true;
}
add_filter( 'woocommerce_show_variation_price', 'ssp_always_show_variation_prices', 99, 3);
For the second, currently, my only turnaround is to define only variable products, even if only one variation.
Let me know
Regards
Pat
Hi Pat, the wpv-woo-buy-options shortcode is only intended for use in the context of a single product post. It's not intended for use in a View. Here's the information from our documentation about the wpv-woo-buy-options shortcode:
This shortcode outputs the Add to cart button on the Product detail pages for simple products. For Variable products, a user will be presented with a drop-down menu of Variations to select from. For other product types, the shortcode output will adjust automatically to the correct Add to cart button output...
Two other shortcodes are available for use in a Product View: wpv-woo-buy-or-select and wpv-woo-product-price. More information about those here:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-woo-buy-or-select
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-woo-product-price
Hi Christian and thanks for your answer,
I was aware of the other shortcodes, but to me, there is an issue as you can have different types of products (simple, variable) and also, some of them could have the same variation price !
So, if I need to built a Views able to treat all these products types, then, I should use a shortcode for variable, another one for simple and then, the issue with the variable using the same variation price is still there !!!
I know I can use the product price shortcode, but for variable products, this means 2 times the price info !!!
My recommendation would be to have a specific mecanism inside the [wpv-woo-buy-options] shortcode that could prevent this kind of issue?
Would be good to transfer this to your development team in order to see if something is feasible.
Regards
Pat
Okay I will reassign this ticket to Beda, who reviews all feature requests for Views and WooCommerce Views. He will analyze the information and follow up with you soon. Thanks for the report!
Hello Pat.
You might check upon the product type.
hidden link
Return that in a Custom Function or ShortCode, and use it in a Conditional HTML:
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/
I will file the feature request but cannot grant this will be implemented any time soon.
WooCommerce Views will be receiving development only after the current many to many development processes.
Hi Beda,
Thanks for your info.
I'm OK to leave like this for the moment. We'll see what the developpers could propose for the future.
Regards
Pat