When PayPal is active on a store and Smart Buttons are enabled for the Single Product page and the Cart, then two AJAX requests run when viewing the single product page of a Simple Product:
If someone hooks into the woocommerce_cart_shipping_packages hook and inspect the cart items there, they would notice that in one of the requests the line totals are set and in another request they are not set, causing an inconsistency:
1/2 requests (missing line totals):
2/2 requests:
To Reproduce
Enable only WooCommerce and PayPal Payments.
Enable Smart buttons for the Single Product page and the Cart.
Describe the Bug
When PayPal is active on a store and Smart Buttons are enabled for the Single Product page and the Cart, then two AJAX requests run when viewing the single product page of a Simple Product:
If someone hooks into the
woocommerce_cart_shipping_packages
hook and inspect the cart items there, they would notice that in one of the requests the line totals are set and in another request they are not set, causing an inconsistency:1/2 requests (missing line totals):
2/2 requests:
To Reproduce
Expected Behavior
When
woocommerce_cart_shipping_packages
all calculations must have been completed and cart items should consistently have all line totals.Actual Behavior
In some requests, the line totals are missing from the cart items.
Environment
Clean WordPress install with only WooCommerce and PayPal Payments active.