Modal offer

The modal offer is a UI component representing Evy offers along with the list of coverage options.

This component can be triggered on-demand.

Display of the component

The component is hidden by default, and it needs to be shown using a script.

The modal component may be also used as a sidebar.

Constructor

The Evy.components.modalOffer factory creates new instances of the components. The instances should be then passed to the evy context object using the addComponents method.

The factory takes parameters using an object with the following keys.

ParameterTypeDescription
product{productId: string, categoryId: string, price: number}The product description
modalTypestring = left, right, centerThe type of modal layout. The default value is center.

Methods

modalOffer.open

Toggles the modal visibility: displays the modal when it is hidden, and hides it if it is displayed.

This method takes no parameters.

Example

const modalOffer = Evy.components.modalOffer({
  product: {productId: 'ME24712745', categoryId: '123', price:5000},
});

evy.addComponents([modalOffer]);

modalOffer.open();