Class: ChooseYourDeliveryListener

ChooseYourDeliveryListener()

'choose_your_delivery' - triggered when the user clicks on a delivery option on the product page. Supports the new and old PDP widgets.

Constructor

new ChooseYourDeliveryListener()

Source:

Extends

Classes

ChooseYourDeliveryListener

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>
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.
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.
Source:
Returns:
- An array of DeliveryOptionButton instances.
Type
Array.<DeliveryOptionButton>