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

fix: hide free sticker notice when stickers are added to the shopping cart #264

Merged
merged 2 commits into from
Apr 19, 2019
Merged

fix: hide free sticker notice when stickers are added to the shopping cart #264

merged 2 commits into from
Apr 19, 2019

Conversation

KirankumarAmbati
Copy link
Contributor

@KirankumarAmbati KirankumarAmbati commented Apr 13, 2019

closes #246

Copy link
Contributor

@jlengstorf jlengstorf left a 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.

@@ -340,6 +341,12 @@ class Cart extends Component {
(total, item) => total + item.quantity,
0
);

checkout.lineItems.forEach(({title}) => {
if(title === 'Gatsby Sticker Pack') {
Copy link
Contributor

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.

Copy link
Contributor Author

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 ?

Copy link
Contributor

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!

Copy link
Contributor Author

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!

@jlengstorf jlengstorf changed the title closes #246 - Free Gift bug fix: hide free sticker notice when stickers are added to the shopping cart Apr 15, 2019
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.

Free Gift bug - It shows a free sticker pack with stickers
2 participants