All code goes in: Global(Site) page; masterPage.js unless you changed the name
import wixStores from 'wix-stores';
$w.onReady(function(){
//CAPTURE WHEN QTY CHANGES FOR THE ITEM BELOW
let productID = "???"; //Your productId (INSTRUCTIONS BELOW)
let productName = "???" // Your product's Name
wixStores.onCartChanged((cart) => {
const cartId = cart._id;
const cartLineItems = cart.lineItems;
// qtyMSB is a Multi State Box
// toggleSwitch is a Switch
for (let i = 0; i < cart.lineItems.length; i++) {
if (cartLineItems[i]["name"] === productName){
if (cartLineItems[i]["quantity"] > 1) {
if (!$w("#qtyMSB").collapsed) {
$w("#qtyMSB").show();
}
}
}
}
});
$w("#toggleSwitch").onChange( (event) => {
if ($w("#toggleSwitch").checked) {
$w("#qtyMSB").collapse();
}
});
});
Instructions
To programmatically get your store's details for an item you can perform the following steps:
1) If not already, turn on Dev Mode
2) Make sure the item(s) you want to monitor are in your cart (can be done in preview mode)
3) Add the following code to the Global(Site) page; masterPage.js unless you changed the name
$w.onReady(function () {
wixStores.onCartChanged((cart) => {
const cartId = cart._id;
const cartLineItems = cart.lineItems;
for (let i = 0; i < cart.lineItems.length; i++) {
console.log(cartLineItems[i])
}
});
});
4) Click Add to Cart OR increase the quantity in the cart
5) Expand the arrows in the Developer Console to get the values you need with Wix's identifier for that value

I hope this helps.