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

[amp story shopping] Set active product data in store service #37013

Closed
processprocess opened this issue Nov 19, 2021 · 0 comments · Fixed by #37103
Closed

[amp story shopping] Set active product data in store service #37013

processprocess opened this issue Nov 19, 2021 · 0 comments · Fixed by #37103

Comments

@processprocess
Copy link
Contributor

processprocess commented Nov 19, 2021

Description

When a shopping-tag is clicked:
Add an 'activeProductData' key to SHOPPING_DATA.
Set the value to the shopping data (ShoppingConfigDataDef) of the clicked item.

Example implementation of a handler in amp-story-shopping-tag:

const shoppingData = this.storeService_.get(StateProperty.SHOPPING_DATA);
this.storeService_.dispatch(Action.ADD_SHOPPING_DATA, {
   'activeProduct': activeProductData[product-tag-id]
});

An alternate option would be to send the productData from the click handler, this would remove the get from the click handler.

@processprocess processprocess added this to To do in wg-stories Shopping via automation Nov 19, 2021
@jshamble jshamble moved this from To do to In progress in wg-stories Shopping Nov 23, 2021
@processprocess processprocess changed the title [amp story shopping] Set active product in store service [amp story shopping] Set active product data in store service Dec 3, 2021
@processprocess processprocess added this to To do in wg-stories Sprint via automation Dec 8, 2021
@processprocess processprocess moved this from To do to In progress in wg-stories Sprint Dec 8, 2021
wg-stories Sprint automation moved this from In progress to Done Dec 22, 2021
wg-stories Shopping automation moved this from In progress to Done Dec 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants