chec / commercejs-nextjs-demo-store

Commerce demo store built for the Jamstack. Built with Commerce.js, Next.js, and can be one-click deployed to Netlify. Includes product catalog, customer login, categories, variants, cart, checkout, payments (Stripe) order confirmation, and printable receipts.
https://commercejs-demo-store.netlify.app/
BSD 3-Clause "New" or "Revised" License
1.07k stars 206 forks source link

Totals issue at checkout and receipt page #93

Closed eufandem closed 4 years ago

eufandem commented 4 years ago
Screen Shot 2020-08-12 at 11 18 29 AM
john-raymon commented 4 years ago

It seems like the wrong totals are deriving from the checkout token object.

image

john-raymon commented 4 years ago

For some reason the live.line_items.line_total prices for the items are different from the live.line_items.price prices. The live object's total reflects the prices from the live.line_items.line_total.

@robbieaverill @ScopeyNZ is live.line_items.price deprecated? I'm not sure why the two are different prices if in this scenario there's only 1 quantity for each of the two items being checked out.

image

ScopeyNZ commented 4 years ago

Is it adding a variant price? I think the price on the line_item response there is the base price for the product, without any variant price deltas added.

ScopeyNZ commented 4 years ago

Looking at the products, I'm guessing that first line item (complexion cream) has the "500ml" variant, which will add $57 to the line item total.

john-raymon commented 4 years ago

@ScopeyNZ I'm also noticing some discrepancies within the order receipt object.

Here a variant of the Lip Fantastic product is checked out, but yet the total only shows 34.50 within the order receipt object while the subtotal is 59.

image

robbieaverill commented 4 years ago

Fixed in #95, nice work @john-raymon