const products = [
{
“productId” : “7someproductlongwixstorejumbledextrem7” ,
“quantity” : 1
},
{
“productId” : “3someproductlongwixstorejumbledextremf” ,
“quantity” : 1
},
{
“productId” : “1someproductlongwixstorejumbledextrem7” ,
“quantity” : 1
}
];
adding this only once using:
cart.addProducts(products).then(open cart page only but do not check out)
if come back to same product page and click add to cart it should not add one more copy of digital file.
possible solution comes to mind it
-
disable button if cart already has 3 files. else enable add to cart button.
-
before adding check for empty cart if false return else add
-
cartIcon shows a number, is there a way to get that number with hooks? if yes, how?