#wagamumma_best-practices
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1369248996387983392
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- wagamumma_webhooks, 3 days ago, 14 messages
- wagamumma_webhooks, 4 days ago, 17 messages
shippingRates: [
{
id: 'free-shipping',
displayName: 'Free shipping',
amount: 0,
deliveryEstimate: {
maximum: {unit: 'day', value: 7},
minimum: {unit: 'day', value: 5}
}
๐ happy to help
id: 'free-shipping', for example if I add more shipping options do I just make up ID's or are they all added in dashboard first?
the ID is something you can configure
it doesn't have to be created in the dashboard first
ok so I can just use anything in the code and it'll just work without touching the dashboard side?
yes
hi! I'm taking over this thread. let me know if you have other questions.
hi I have added a test shipping rate which is not free, it displays correctly but the actual total displayed doesn't seem to be adding it on, how would this work please?
(the cart total without shipping was ยฃ50.00 so this should be ยฃ55.99 now(
can you share your frontend code that steps this up?
shippingRatesArr=[
{
id: 'standard-shipping',
displayName: 'Standard shipping',
amount: 599,
deliveryEstimate: {
maximum: {unit: 'day', value: 7},
minimum: {unit: 'day', value: 5}
}
},
]
const optionsExpress = {
shippingAddressRequired: true,
allowedShippingCountries: ['GB'],
shippingRates:shippingRatesArr,
emailRequired: true,
phoneNumberRequired: true,
};
this?
// Set up Stripe.js and Elements to use in checkout form.
const elements = stripe.elements(options);
// Create and mount the Express Checkout Element
const expressCheckoutElement = elements.create('expressCheckout',optionsExpress);
thanks! and do you have a URL where I can reproduce the issue?
you'd need to in Chrome add something to your cart like this product: https://www.gordonsmithmalvern.co.uk/prod/14679/Emma+J+Shipley+Zambezi+Navy+Wallpaper+W0121+04/
Please note: This wallpaper is 52cm wide and is sold per roll.
then you'd need to go to this link (it just activates a session to show the express checkout as it's all in testing still
you should see the google pay button then
yep I managed to reproduce the issue on your website. looking into this
thanks ๐
can you try removing allowedShippingCountries: ['GB'], for now, to see if that changes anything?
oh wait, I think what you see is expected. you need to listen to the shippingaddresschange event to detect when a customer selects a shipping rate, and call elements.update({amount: result.amount})
this is explained here: https://docs.stripe.com/elements/express-checkout-element/accept-a-payment#collect-shipping
I see but what if this is the only option? they dont really need to change the rate in that instance?
agreed, but you still need to do this step for it work properly
so does it listen for a change on first load as well then? I dont really understand how it'd ever call the function if they dont change anything so the price would never update
I'm not super familiar with this myself. can you try to follow what the docs suggest? and if it doesn't fix the issue, I'll look into it more deeply.
ok not a problem I will try now thanks