Can multiple products be managed by OptionSelectors?

Highlighted
New Member
1 0 0

I need to manage multiple products in an OptionSelectors or instantiate more than one instance of OptionSelctors in a way where they do not conflict with one another. 

 

I have a switch statement that triggers the following:

 

jQuery(function($) {  
    new Shopify.OptionSelectors( "pick-zinc-type",
      {
        product: zincProduct,
        onVariantSelected: selectCallbackZinc,
        enableHistoryState: true 
      });
  })  
 jQuery(function ($) {
      new Shopify.OptionSelectors("pick-geo-type",
        {
          product: geoProduct,
          onVariantSelected: selectCallbackGeo,
          enableHistoryState: true
        });
    })

I have not gotten the above to work. Is it only possible to have one selectCallback that has to manage them all? Or is it possible to have the selectors separate? 

 

This is on a single 'product page' that renders after a vehicle sear. When a user is taken here there may be a product for either or both of the above up to a total of 5 different products. All with multiple variants.

0 Likes