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

[Cart] Updated decpreciated discounts property on line items #2760

Merged
merged 1 commit into from
Jul 7, 2023

Conversation

ludoboludo
Copy link
Contributor

PR Summary:

We're using the discounts property in our cart a couple times. This is being depreciated so this PR aims to update that property to the recommended one discount_allocations.

Why are these changes introduced?

Fixes #1856

What approach did you take?

Replaced the property being called. It's also an array so shouldn't require anything else.

Other considerations

Here are our dev docs mentioning the depreciation.

Visual impact on existing themes

Shouldn't have any

Testing steps/scenarios

  • Add an item in the cart that will have a discount applied to it. The Louise slide sandal should do 👍

Demo links

Checklist

Copy link
Contributor

@lougoncharenko lougoncharenko left a comment

Choose a reason for hiding this comment

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

This looks good on my end. I tested the following and didn't find any issues:

  • Tested the PR in mobile, tablet and desktop
  • Tested on safari and chrome browsers
  • Searched through the code base to ensure that all of items.discounts were replaced with item.discount_allocations.
  • Added an item with a discount into the shopping cart to ensure the discount was applying
  • Added more than one item to the cart to ensure the total was accurate and discounts were still applying.
  • Tested for accessibility by turning on the screen reader and viewing the cart page. The screen reader read of the discounted price.

@ludoboludo ludoboludo merged commit 0ee39ad into main Jul 7, 2023
5 checks passed
@ludoboludo ludoboludo deleted the discounts-object-update branch July 7, 2023 14:16
@ludoboludo ludoboludo mentioned this pull request Jul 7, 2023
11 tasks
phapsidesGT pushed a commit to Gravytrain-UK/gt-shopify-dawn-theme that referenced this pull request Sep 3, 2024
This pull request was closed.
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.

line_item.discounts is deprecated, but currently used
3 participants