Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Discounts] fix: show accurate subtotal price for cart #2775

Merged
merged 8 commits into from
Jul 11, 2023

Conversation

mathiusj
Copy link
Contributor

@mathiusj mathiusj commented Jul 5, 2023

PR Summary:

Updates total price to be items_subtotal_price to more accurately represent the value after line item discounts only.

Before:

image

After:

image

image

Why are these changes introduced?

fixes: https://github.com/Shopify/core-issues/issues/57440
fixes: #2781

What approach did you take?

Other considerations

Decision log

# Decision Alternatives Rationale Downsides
1

Visual impact on existing themes

Testing steps/scenarios

manually edited in store editor: https://admin.web.fix-inaccurate-total.mathius-johnson.us.spin.dev/store/shop1/themes/1?key=sections%2Fmain-cart-footer.liquid

cart: https://shop1.shopify.fix-inaccurate-total.mathius-johnson.us.spin.dev/cart

  • add products to cart
  • go to checkout and add product + order discounts (take note of total price after order discount)
  • go back to cart and confirm subtotal accurately reflects amount of line items - line item discounts, order discount not included (should be a higher amount than total price with order discount applied)

Demo links

Checklist

@mathiusj mathiusj changed the title fix: show accurate subtotal price for cart [Discounts] fix: show accurate subtotal price for cart Jul 5, 2023
@mathiusj mathiusj requested review from aeperea and devisscher July 5, 2023 22:01
@devisscher
Copy link

This looks clearer for the merchant, but as you mentioned @mathiusj, an additional total line after the order discounts are applied could make it even clearer. Another thing to account for is the cart drawer, which should be found here, see screenshot below.:

image

@ludoboludo
Copy link
Contributor

Hey folks, not a review but just some context around some other things we were looking into for the customer account page. We wanted to make the hierarchy of the information similar to what you (customer) also receive as an email notification. So we have some consistency.

Here is a PR about it. It's not directly related but maybe good to know/be aware of for consistency across the board 👍

@@ -272,8 +272,8 @@
"title": "Your cart",
"caption": "Cart items",
"remove_title": "Remove {{ title }}",
"subtotal": "Subtotal",
"new_subtotal": "New subtotal",
"estimated_total": "Estimated Total",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Localization quality issue found

The following issues may affect the quality of localized translations if they are not addressed:

  • The value Estimated Total for key sections.cart.estimated_total is very short. Short strings are more likely to be misunderstood by translators without context. Please provide additional context for the translators if possible.

Please look out for other instances of this issue in your PR and fix them as well if possible.

Questions about these messages? Hop in the #help-localization Slack channel.

@mathiusj mathiusj force-pushed the mathiusj/gh-57440-fix-inaccurate-subtotal-price branch 3 times, most recently from 6ae58e0 to f35050a Compare July 7, 2023 15:07
@mathiusj mathiusj requested a review from kjellr July 7, 2023 15:08
@mathiusj mathiusj force-pushed the mathiusj/gh-57440-fix-inaccurate-subtotal-price branch from f35050a to 8e796cc Compare July 7, 2023 15:09
Comment on lines +24 to +26
.totals__total {
margin-top: .5rem;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need this. It applies that margin top even when there are no discounts above it.

We do have this existing declaration:

.cart__footer .discounts {
    margin-top: 1rem;
}

Which could be changed to margin-bottom 👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then I'd like to see what a designer will think as the spacing between the total and the taxes and shipping... is bigger than between the discount and the total 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spacing looks good on my end. We can revise further if we decide to bring the subtotal in here too. 👍

@@ -272,8 +272,8 @@
"title": "Your cart",
"caption": "Cart items",
"remove_title": "Remove {{ title }}",
"subtotal": "Subtotal",
"new_subtotal": "New subtotal",
"estimated_total": "Estimated total",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Localization quality issue found

The following issues may affect the quality of localized translations if they are not addressed:

  • The value Estimated total for key sections.cart.estimated_total is very short. Short strings are more likely to be misunderstood by translators without context. Please provide additional context for the translators if possible.

Please look out for other instances of this issue in your PR and fix them as well if possible.

Questions about these messages? Hop in the #help-localization Slack channel.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a new screenshot with more details for the translation platform 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!!! 🙏

Copy link
Contributor

@ludoboludo ludoboludo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good to me 👍

One note, some stores could be using free shipping methods only and include taxes in their product prices. So the total amount on the cart page could be exactly the same as the one during checkout.
Though since you can always add a discount during checkout, I think it's ok to keep it as is 👍

⚠️ And we will need to wait for the translations to be back before merging.

Copy link
Contributor

@kjellr kjellr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good from the UX side. Thank you! 🙌

@mathiusj mathiusj force-pushed the mathiusj/gh-57440-fix-inaccurate-subtotal-price branch from 3b876ec to 7b4e630 Compare July 11, 2023 15:40
@mathiusj
Copy link
Contributor Author

/shipit

@mathiusj mathiusj merged commit 45bced2 into main Jul 11, 2023
@mathiusj mathiusj deleted the mathiusj/gh-57440-fix-inaccurate-subtotal-price branch July 11, 2023 15:55
lougoncharenko pushed a commit that referenced this pull request Jul 12, 2023
* fix: show accurate subtotal price for cart

* chore: update subtotal in cart drawer

* chore: update copy for estimated total, adjust spacing and placement

* fix: use cart__footer selector for margin instead

* fix: make copy sentence case

* Update 20 translation files

* Update 3 translation files

* Update 7 translation files

---------

Co-authored-by: translation-platform[bot] <34770790+translation-platform[bot]@users.noreply.github.com>
phapsidesGT pushed a commit to Gravytrain-UK/gt-shopify-dawn-theme that referenced this pull request Sep 3, 2024
* fix: show accurate subtotal price for cart

* chore: update subtotal in cart drawer

* chore: update copy for estimated total, adjust spacing and placement

* fix: use cart__footer selector for margin instead

* fix: make copy sentence case

* Update 20 translation files

* Update 3 translation files

* Update 7 translation files

---------

Co-authored-by: translation-platform[bot] <34770790+translation-platform[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate if content in cart needs to be updated to show Total as well as Subtotal
5 participants