Hi @skalanter
I want to chime in as a similar issue has been bothering me for a while.
WooCommerce itself only adds ajax features on the Shop (archive) page. OceanWP takes that functionality and includes it on the single product page. You’re doing it this way because you want to use WooCommerce standards as much as possible. That’s great, and I applaud that in many cases.
But in this case, the WooCommerce standard is not enough. Their ajax behavior was not meant to run on the single product page. In using it, you create UX problems. If “add to cart” fails, the user is never alerted and instead sees the “product added” message.
Enabling Ajax through OceanWP therefor breaks all validation messages Woo might show (such as stock errors) but also breaks all plugins that depend on extra cart validation, such as WooCommerce Product Add-ons, WooCommerce Bookings, etc … (basically any plugin that adds options to the product page and needs to validate user selection/input).
Therefore, I vote that you implement proper ajax behavior for the single product page, as many other themes have done.
The reason why WooCommerce’s built-in ajax functionality works on the archive page is because they know there can’t be any stock errors (you can only add 1 item to cart and the button won’t show for items out of stock/unpurchaseable). The story is different on the single product page, where users can select variations and add any quantity.
Please send this to OceanWP’s decision makers for consideration. If it helps, here are some other tickets backing this issue, just to show this may require some reconsideration from your end:
https://www.ads-software.com/support/topic/notices-after-ajax-add-to-cart-2/
https://www.ads-software.com/support/topic/issue-with-ajax-add-to-cart/
https://www.ads-software.com/support/topic/add-to-cart-function-on-single-product-page/
Thanks!
-
This reply was modified 6 months, 2 weeks ago by Maarten.