Hi @
I was able to re-create the described issue by following your instructions.
Are you using any 3rd party plugins for your shipping integration?
Here is an explanation of why I think this is happening.
- When you make a product variation select, or when the product page loads, the Stripe plugin makes a request to the
https://www.magped.com/en/?wc-ajax=wc_stripe_frontend_request&path=/wc-stripe/v1/cart/cart-calculation
endpoint.
- This endpoint performs a cart calculation, using the WooCommerce cart, so the Stripe plugin can get the request object that Apple Pay needs when launching the Apple Pay wallet. The click event for the Apple Pay button must be synchronous, which means you have to have all of the request data at the time of the button being clicked.
Here is the response from your server when performing that cart calculation:
{
"data": {
"stripe_applepay": {
"total": "128.00",
"subtotal": "119.00",
"totalCents": 12800,
"displayItems": [
{
"label": "magped SPORT2 - 200N, green",
"pending": false,
"amount": 11900
},
{
"label": "Shipping",
"pending": false,
"amount": 900
}
],
"shippingOptions": [
{
"id": "0:flat_rate:13",
"label": "Shipping fee",
"detail": "",
"amount": 900
}
]
},
"stripe_payment_request": {
"total": "128.00",
"subtotal": "119.00",
"totalCents": 12800,
"displayItems": [
{
"label": "magped SPORT2 - 200N, green",
"pending": false,
"amount": 11900
},
{
"label": "Shipping",
"pending": false,
"amount": 900
}
],
"shippingOptions": [
{
"id": "0:flat_rate:13",
"label": "Shipping fee",
"detail": "",
"amount": 900
}
]
}
}
}
You will notice that the shippingOptions
array only contains a single option, which is the flat rate fee. The Stripe plugin simply calls WooCommerce provided methods when performing the cart calculation, so for some reason your shipping logic is deciding to not include the free shipping option.
Subsequent changes to the Apple Pay shipping address will result in the free shipping option being included.
I suspect what’s going on is your shipping integration is not playing nice with the WooCommerce cart session and the address data used to calculate the available shipping options isn’t persisting across requests.
Kind Regards