Copy console .log ( igData . campaigns .getGWP ({achieved : true }))
[
{
giftWithPurchaseProductId : "7191907565616" ,
giftWithPurchaseVariantId : null ,
autoAddGiftWithPurchase : false ,
giftWithPurchaseHandle : "ceramic-risotto-plate" ,
id : "0c8f4018-4b42-45ae-9fc4-8f5a9969c32a" ,
minimumUnits : 100 ,
unitDiscount : 0 ,
isFreeShipping : true ,
isGiftWithPurchase : true ,
}
]
Copy [
{
autoAddGiftWithPurchase : boolean , //if Intelligems will automatically add the GWP to cart
giftWithPurchaseProductId : string | null , // Shopify Product ID (i.e. "7191907565616")
giftWithPurchaseVariantId : string | null , // Shopify Variant ID (i.e. "435713513473145")
giftWithPurchaseHandle : string | null , // Shopify handle (i.e. /products/<handle>)
isGiftWithPurchase : boolean ,
isFreeShipping : boolean ,
minimumUnits : integer , // minimum requirement to be eligible, in dollars or items
}
]
Copy fetch ( "/cart/add.js" , {
method : "POST" ,
headers : {
"Content-Type" : "application/json" ,
} ,
body : JSON .stringify ({
items : [{
id : variantID ,
quantity : 1 ,
properties : {_igGWP : "true" }
}])
}
);