This code will prevent customers from checking out unless they have at least two items in their shopping cart.
1. Go to the 'Design' tab and select 'Checkout Page 1' from the 'Select Page Type' drop-down list.
2. Click on the 'Next>' button in the design.
3. Replace the code in the 'Checkout Next Button' layout with the following:
Note: Where it says:
the '2' can be replaced with another minimum quantity.
1. Go to the 'Design' tab and select 'Checkout Page 1' from the 'Select Page Type' drop-down list.
2. Click on the 'Next>' button in the design.
3. Replace the code in the 'Checkout Next Button' layout with the following:
HTML Code:
<script language="JavaScript"> <!-- /************************************************************/ * * getCartItem-Gets the SellerDeck Cart Value & No of Items * *************************************************************/ //CART_CONTENT = Cookie name //1 = TOTAL_VALUE //3 = CART_COUNT function getCartItem(index) { var act_cart= getCookie("CART_CONTENT") temp =(act_cart != null) ? temp=act_cart.split("\t"):0; return (temp.length > 0) ? temp[index] : 0; } // --> </script> <input type=SUBMIT name=ACTION value="<actinic:variable encoding="html" name="NextButton" />" onclick="if (getCartItem(3) >= 2) {return true;} else {alert('Minimum order is 2 items');return false;}">
Note: Where it says:
HTML Code:
if (getCartItem(3) >= 2)