bug: fix cart "Subtotal" label that included shipping fee#44
Open
devin-ai-integration[bot] wants to merge 2 commits into
Open
bug: fix cart "Subtotal" label that included shipping fee#44devin-ai-integration[bot] wants to merge 2 commits into
devin-ai-integration[bot] wants to merge 2 commits into
Conversation
Co-Authored-By: david.bean <david.bean@cognition.ai>
Co-Authored-By: david.bean <david.bean@cognition.ai>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The cart footer showed a single line labeled "Subtotal" whose value silently included shipping — the same mislabeling found during the ThriftBooks audit (where "Cart subtotal" actually displayed the shipping-inclusive grand total). A shopper saw
Subtotal: $61for a$56item with no indication that $5 shipping was baked in.This PR makes the cart breakdown explicit and correctly labeled:
Subtotalnow reflects items only (totalPrice).Shippingis a separate line driven by a newSHIPPING_FEEconstant inlib/utils.js.Total(items + shipping) is shown as the emphasized grand total via a.total-duestyle, matching what Stripe actually charges.Notes
SHIPPING_FEEis a flat constant for demo purposes (the existing Stripe flow already attaches a shipping rate at checkout); the value just needs to align conceptually.Before / After
Before — single line labeled "Subtotal: $61" for a $56 item (shipping hidden inside):
After — itemized Subtotal $56 / Shipping $5 / Total $61:
Link to Devin session: https://app.devin.ai/sessions/decb8eb7a1d54b3d925f5f1459fb4a64
Requested by: @davidbean-hash
Devin Review