g

Free Items

Using Discounts you can set the action to provide a customer with a 100% discounted product or bundle. This information is returned under the "suggest" key with any Cart3 response.

Under this key we have the value "changed" - which is what we use to monitor the free item state, this will allow you to prompt the user to add an item.

"changed" is not monitoring the state of qualified free items, but all free items loaded within the cart itself. 

For documentation of how to setup this type of Discount, click here.

Example

We have a Free Item Discount setup to provide us with "Free Product Test" when our product in the cart ; "Product A" has a quantity of two.

"changed" is true but we have no qualified items, this happens because the state of free items has updated... but we still do not qualify for them. 

We need to update our quantity to two in order to qualify...

Note how "changed" is now true, and we have qualified for a free item.

Updating the quantity to three will result in: 

"changed" is false as we still have the same state of free items.

Adding the Free Product will return:

The state remains false as the free items loaded remains the same.

If we remove the free product:

"changed" still remains false as we still have a free product qualified..

Now finally, we chaned Product A back to quantity one:

"changed"" is now true, as the state of the free items has updated - we are no longer loading a free item.