Using Corvid to create popup for minimum subtotal in cart

Hey! Does anyone know how to create a code to show a popup or not allow someone to proceed to checkout unless their subtotal is at least $200? I’m setting up a wholesale site and require a minimum.

Thanks!!

Are You using wix-store ?
Do you want that pop-up at Cart Page ?

If YES,

  1. You Need to Create one New Web Module on Backend Files.

Usually the Name will be aModule.jsw. Just Hit “Enter”.


And You can see below screen Automatically .
You Just Delete All Codes. { ctrl+a and delete } (Am using Ubundu).


And Paste below Code there

// Filename: backend/aModule.jsw (web modules need to have a .jsw extension)
import wixStoresBackend from 'wix-stores-backend'

export function getCurrentCart() {
 return wixStoresBackend.getCurrentCart();
}

It may Look Like


And Go To Cart Page Code. and Paste the Below Code there.

// API Reference: https://www.wix.com/corvid/reference
// “Hello, World!” Example: https://www.wix.com/corvid/hello-world
import {getCurrentCart} from 'backend/aModule'; 
import wixWindow from 'wix-window';


$w.onReady( async function () { 
 let results = await getCurrentCart(); // Getting Cart Details from Backend
    results = results.totals.subtotal;  // Gettin Only Subtotal Value

 if (results < 200){
        wixWindow.openLightbox("LightboxName"); // Open a popup 
    }

});

Final Look of Cart Page Code Will be —>

Please Make Sure :

  1. You have Create a Light Box (PopUp) Without Closing Button Or Need To Remove The Close button On Right Top Corner (Usually it Appears There).
  2. In LightBox There Should be Only One Button Which Will be Redirecting To the Shop/ Home Page (Your choice).

how to add Light Box ?

Hope It Helps.
Please let me know the Results.

Thanks,
Kottravai