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!!
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,
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).
// 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
// 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 :
how to add Light Box ?
Hope It Helps.
Please let me know the Results.
Thanks,
Kottravai