TryNow JavaScript SDK
Product
The public Product interface. This is stored as a singleton on the window.trynow
object.
This class exposes public methods for product-related interactions with the TryNow Shopify Integration.
Kind: global class
- Product
- .calculateProductVisibilityFromTags(productTags) ⇒
boolean
- .recalculateCtaButtonState(productData) ⇒
Promise.<void>
- .calculateProductVisibilityFromTags(productTags) ⇒
Product.calculateProductVisibilityFromTags(productTags) ⇒ boolean
boolean
Allows the caller to determine if a product should be visible based on the product's tags.
Kind: static method of Product
Returns: boolean
- A boolean indicating if the product should be visible in a TryNow context
Param | Type | Description |
---|---|---|
productTags | Array.<string> | The tags of the product to check visibility for |
Product.recalculateCtaButtonState(productData) ⇒ Promise.<void>
Promise.<void>
Updates the product data within the app. TryNow generates the ShopifyJsProduct object based on fields provided by Shopify.
For more information on the expected schema as defined by Shopify, see Shopify's docs
Kind: static method of Product
Returns: Promise.<void>
- A promise that resolves when the product data has been updated.
Param | Type | Description |
---|---|---|
productData | ShopifyJsProduct | The product data to be used by the app, formatted according to the expected schema. |