|
Chains
Collections
Specials
|
$value ) {
if ( preg_match('/ss_cart_/',$key) ) {
$cookieData = urldecode($value);
$hasCookie = TRUE;
break;
}
}
$matchArray = array(",","\$");
$itemPrice = '$125.14';
$itemPrice = str_replace($matchArray,"",$itemPrice);
if ( $hasCookie == TRUE ) {
preg_match('/SubTotal:\$([\d.]+)/',$cookieData, $subtotalMatch);
preg_match('/LineCnt:([\d.]+)/',$cookieData, $lineCountMatch);
$subtotal = $subtotalMatch[1];
$totalItems = $lineCountMatch[1];
// The user already has enough in their cart for free shipping.
if ( $subtotal > $freeShippingThreshold ) {
echo "Your order qualifies for free shipping!";
// The item being viewed + their current cart items will qualify
// for free shipping.
} elseif ( $itemPrice + $subtotal >= $freeShippingThreshold ) {
echo "Adding this item to your cart qualifies your order for free shipping!";
// The item being viewed + their current cart items + $n will
// qualify for free shipping.
} elseif ( $itemPrice + $subtotal < $freeShippingThreshold ) {
$amountNeeded = "\$".number_format($freeShippingThreshold - $subtotal - $itemPrice,2);
echo "This product plus $amountNeeded more will qualifiy you for free shipping.";
}
} else {
// The item being viewed will qualify for free shipping.
if ( $itemPrice > $freeShippingThreshold ) {
echo "Adding this item to your cart qualifies your order for free shipping!";
// The item being viewed + $n will qualify for free shipping.
} else {
$amountNeeded = "\$".number_format($freeShippingThreshold - $itemPrice,2);
echo "This product plus $amountNeeded more will qualifiy you for free shipping.";
}
}
?>
This sterling silver horse brooch looks incredible with it's mordern sculpture look.
|
|
||||||||||||