-
Notifications
You must be signed in to change notification settings - Fork 220
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
fix: hide free sticker notice when stickers are added to the shopping cart #264
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This looks good, but I have one suggestion to make sure we don't accidentally break this in Shopify later on.
src/components/Cart/Cart.js
Outdated
@@ -340,6 +341,12 @@ class Cart extends Component { | |||
(total, item) => total + item.quantity, | |||
0 | |||
); | |||
|
|||
checkout.lineItems.forEach(({title}) => { | |||
if(title === 'Gatsby Sticker Pack') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we may want to check for something other than the title — there's no guarantee we won't tweak the name of the product. Something like the slug or ID would probably be better here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jlengstorf Gatsby Sticker Pack ID is having 140 characters length. Is it okay to use it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That should be fine. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jlengstorf Made changes to replace title
with ID
. Please can you verify. Thanks!
closes #246