Class: ChooseYourScentListener

ChooseYourScentListener()

'choose_your_scent' - triggered when the user clicks a scent option on a product page. Supports the new and old PDP widgets and most GemPages product templates.

Constructor

new ChooseYourScentListener()

Source:

Extends

Members

selectors :Array.<string>

Depending on the product page, the scent buttons may have different selectors. This array contains all the selectors we're interested in.
Type:
  • Array.<string>
Overrides:
Source:

Methods

createOptionButton(selector, element) → {DeliveryOptionButton}

Abstract factory method for creating DeliveryOptionButton instances. This allows the subclasses to create different types of OptionButtons. (ie Scent, Delivery)
Parameters:
Name Type Description
selector string The selector used to find the button.
element HTMLElement The button element.
Overrides:
Source:
Returns:
- An instance of DeliveryOptionButton.
Type
DeliveryOptionButton

getOptionButtons() → {Array.<DeliveryOptionButton>}

Gets the option buttons on the page. Uses the selectors array to find the buttons. Uses the `createOptionButton` method to create the button instances.
Inherited From:
Source:
Returns:
- An array of DeliveryOptionButton instances.
Type
Array.<DeliveryOptionButton>