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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants