This code uses a themed box  and attaching a product to the box and a button that will close the page on click and onMouseOut to close window .( Single offer)

import wixWindow from 'wix-window';

$w.onReady(function () {
    setTimeout(function () {
        $w("#UpsellOne").expand();
    }, 4000);

    $w("#close").onClick(function () {
        $w("#UpsellOne").collapse();
    });

    $w("#UpsellOne").onMouseOut(function () {
        $w("#UpsellOne").collapse();
    });
});

The following Code uses, a multi state box connect to 2 different products and two different buttons to collapse Box  2 states to change offers before selecting. 

$w.onReady(function () {
    // set initial state to FirstOffer
    $w("#UpsellOne").changeState("FirstOffer");

    // expand to SecondOffer state after 4 seconds
    setTimeout(() => {
        $w("#UpsellOne").expand();
        $w("#UpsellOne").changeState("SecondOffer");
    }, 3000);

    // change state every 5 seconds
    const states = ["FirstOffer", "SecondOffer"];
    let stateIndex = 0;
    setInterval(() => {
        stateIndex = (stateIndex + 1) % states.length;
        $w("#UpsellOne").changeState(states[stateIndex]);
    }, 5000);

    // onClick handler for closeBTNone button
    $w("#closeBTNone").onClick(() => {
        $w("#UpsellOne").collapse();
    });

    // onClick handler for closeBTNtwo button
    $w("#closeBTNtwo").onClick(() => {
        $w("#UpsellOne").collapse();
    });

    // onMouseOut handler for UpsellOne multi-state box
    $w("#UpsellOne").onMouseOut(() => {
        $w("#UpsellOne").collapse();
    });
});