Cart offer

This widget is designed to be used in a cart page. It displays the attached offer if there is one; otherwise, it displays a button that shows a Modal offer component.

Component display

When there is no offer attached to the product

The modal display after triggering the button

When an offer is selected and the “Add protection” button is clicked, the offer becomes attached to the specified product. The modal is closed.

Offer display

Constructor

Props

ParameterTypeDescription
productIdstringThe product ID, as uploaded to the Evy API
pricenumberThe quantity of product

Example

import { CartOffer } from "@getevy/react-sdk";

export const ProductLine = ({ productId, price }) => {
  return;
  <>
    <ProductDisplay />
    <CartOffer productId={productId} price={price} />;
  </>;
};