I am trying to:
Products (variable product) with 1 attribute (color) does not show the price when you select a Color. It *WILL* work if you set both the Sale price and Regular price. But if you only have regular prices set for all variations then the price will never show up.
Link to a page where the issue can be seen:
hidden link
I expected to see:
Prices for all variations should show up when you select a variation, regardless of whether there is a sale price or regular price.
Instead, I got:
If a product has ONLY regular prices for all variations, it will not show the product price. if AT LEAST ONE of the variations has a sale price then ALL of the variations will show their prices properly.
On the Bello page:
hidden link
The Bath Sheet is a product whose Color Almond has a regular AND sale price. Thus all variations will show their correct prices when selected.
The Bath Towel is another product, but all variations have only their Regular prices set, with NO sale prices, thus, no prices show up at all when you select the Color.
The Layout for this entire page is: "Single Style with Products"
The VIEW that is used for these products is: "Products for a Style"
Hi can you confirm this behavior happens when you have a default theme like Twenty Nineteen active, and only Toolset and WooCommerce plugins active? If not, can you tell me if you're using any WooCommerce extensions? If you can add your site's debug information that will be helpful.
Okay and I can see there is at least one relevant custom plugin in use here: woocommerce-steversio-ajax-addtocart-variations
Is the problem occurring with that plugin deactivated? I'm not sure if you wanted me to make changes on the live site so I didn't test it myself.
Yes it still occurs with that plugin deactivated.
I apologize i never got an email stating you responded. I'll check back more frequently.
Please feel free to make any (reversable) changes you need to. Or if you just want to point me in the right direction? It just seems so odd for this behavior to be happening and I thought i narrowed it down to the Toolset shortcode specifically, thus why I'm here on your support forums.
Thank you for all your help so far!
Okay thanks, and you are correct in that it can definitely be narrowed down to Toolset and WooCommerce. I was able to replicate the issue on my own local site in a View of Products, so I will escalate this to my 2nd tier support team for additional investigation. I'll let you know what I find out. Thanks for your patience.
Okay it turns out this is actually the expected behavior for this shortcode. It's not so much because there is no sale price, as it is all the variations for this product currently have the same price. To understand what is happening, you can temporarily deactivate Toolset plugins and visit one of the variable product posts directly. You'll see that the main price is displayed above the variation select field. If you select one of the variations, no additional price is displayed. However, in one of the variable products where the prices are different in at least one variation, the individual variation price is displayed when you select that variation. So it's not so much a Toolset bug as it is a side effect of how WooCommerce's variable product add-to-cart feature works. Toolset's shortcode is just a wrapper for the same functionality produced by WooCommerce. So I guess you have the option to report this to WooCommerce as a bug in their core functionality, or possibly show the price above the wpv-woo-buy-or-select shortcode using the wpv-woo-product-price shortcode to help clarify things for variable products with no price variations. Let me know if you have questions about that.
https://docs.woocommerce.com/wc-apidocs/function-woocommerce_variable_add_to_cart.html
Thank you so much for looking into this.
You guys have the best support; going above and beyond. I will add the [wpv-woo-product-price] to my markup. I didnt realize this was the behavior of the wpv-woo-buy-or-select. Perhaps that's something they could add to the documentation for it?
I think the way you guys designed it is the most versatile. Along with woocommerce. I think my lack of understanding about the shortcode is what caused the issue.
Thank you again for everything.
My issue is resolved now. Thank you!