Subify SDK
  • Subify SDK for developers
    • Loading SDK
    • `subifySDK` Object Methods
      • renderWidget(product, configs)
      • changeVariant(targetProductId, selectedVariantId)
    • Events
Powered by GitBook
On this page
  1. Subify SDK for developers
  2. `subifySDK` Object Methods

changeVariant(targetProductId, selectedVariantId)

If you are using a customized variation selection approach not supported by the SDK, or if you wish to change the variant in certain situations, you can achieve this by calling the changeVariant method. This method accepts two numerical parameters:

targetProductId: represents the ID of the product for which the variant needs to be changed.

selectedVariantId: corresponds to the ID of the variant that you want to select for the specified product

window.subifySdk.changeVariant(12345,1234567)
PreviousrenderWidget(product, configs)NextEvents

Last updated 1 year ago