Open Evaske opened 1 year ago
I got to the bottom of what was causing this. The attributes that were being applied to variable product had slugs that contained an " character. It was obviously throwing something off with the variation selection once the Paypal window was closed. Removing the " character from all the attribute slugs has fixed the issue.
Maybe add something to stop illegal character from being added in to attribute slugs?
@woocommerce/quark could you please prioritize this?
Prerequisites
Describe the bug
I have a client who was seeing issues occasionally with customers checking out with the parent of a variable product added, which had no variable product SKU and sometimes allowed the customer to checkout with the cheapest price of a variable product.
I have now found what was causing this issue and it is the Paypal Smart Button (Paypal checkout button) on the single product page however this may also happen with other smart button gateways that can appear on the single product page and open a popup window.
Expected behavior
Either when the window is closed, the cart should be emptied or the variable product only should be added to the cart and this shown as 1 in cart (it currently shows as 0 unless you refresh the page).
Actual behavior
On closing the Paypal window quickly, the cart shows as 0 items. If the page is refreshed after closing the Paypal window then the parent item is in the cart. If the "Add To Cart" button is pressed without refreshing then the variation item gets added to the cart as well as the parent item.
If you let the Paypal window fully load and then close it, this adds the correct variation item to the cart but again doesn't update the cart value unless the page is refreshed so you can end up with 2 of the same variation item in the cart on pressing the "Add To Cart" button.
Steps to reproduce
WordPress Environment
Isolating the problem