<?php
$cart = isset($_SESSION['cart']) ? $_SESSION['cart'] : '';
$itemcount = isset($_SESSION['itemcount']) ? $_SESSION['itemcount'] : 0;
$strHTML = "";
if ($itemcount == 0)
{
$strHTML = "<h3>".$empty_cart_label."</h3>";
}
else
{
$strHTML = '<div style="overflow:auto; height:100%;">';
$strHTML .= '<table border="0" cellpadding="3" cellspacing="2" width="100%">';
$strHTML .= '<tr>';
$strHTML .= '<td align="center" bgcolor="'.$TITLE_BCGRD_CLR.'"><font style="font-size:'.$TITLE_TEXT_SIZE.'px" color="'.$TITLE_TEXT_CLR.'" face="'.$TITLE_TEXT_FONT.'"><'.$TITLE_TEXT_STYLE.'>'.$product_code_label.'</'.$TITLE_TEXT_STYLE.'></font></td>';
$strHTML .= '<td align="center" bgcolor="'.$TITLE_BCGRD_CLR.'"><font style="font-size:'.$TITLE_TEXT_SIZE.'px" color="'.$TITLE_TEXT_CLR.'" face="'.$TITLE_TEXT_FONT.'"><'.$TITLE_TEXT_STYLE.'>'.$product_description_label.'</'.$TITLE_TEXT_STYLE.'></font></td>';
$strHTML .= '<td align="center" bgcolor="'.$TITLE_BCGRD_CLR.'"><font style="font-size:'.$TITLE_TEXT_SIZE.'px" color="'.$TITLE_TEXT_CLR.'" face="'.$TITLE_TEXT_FONT.'"><'.$TITLE_TEXT_STYLE.'>'.$product_qty_label.'</'.$TITLE_TEXT_STYLE.'></font></td>';
$strHTML .= '<td align="center" bgcolor="'.$TITLE_BCGRD_CLR.'"><font style="font-size:'.$TITLE_TEXT_SIZE.'px" color="'.$TITLE_TEXT_CLR.'" face="'.$TITLE_TEXT_FONT.'"><'.$TITLE_TEXT_STYLE.'>'.$product_price_label.' '.$currency_symbol.'</'.$TITLE_TEXT_STYLE.'></font></td>';
$strHTML .= '<td align="center" bgcolor="'.$TITLE_BCGRD_CLR.'"><font style="font-size:'.$TITLE_TEXT_SIZE.'px" color="'.$TITLE_TEXT_CLR.'" face="'.$TITLE_TEXT_FONT.'"><'.$TITLE_TEXT_STYLE.'>'.$product_amount_label.' '.$currency_symbol.'</'.$TITLE_TEXT_STYLE.'></font></td>';
$subtotal = 0;
$taxes = 0;
$discount = $_SESSION['discount'];
$total = 0;
$shipping = 0;
//$ship_to_country = isset($ship_to_country)? $ship_to_country : str_replace(" ", "_", $origin_country); // it sets the area to National if it is not defined
$ship_area = isset($ship_to_country)? $area[str_replace(" ", "_", $ship_to_country)]:'0'; // it sets the area to National if it is not defined
for ($i=0; $i<$itemcount; $i++)
{
$BGCOLOR=$BGCOLOR1;
if ($i % 2 == 0) {
$BGCOLOR=$BGCOLOR2;
}
$strHTML .= '<tr>';
$strHTML .= '<td align="center" bgcolor="'.$BGCOLOR.'"><font style="font-size:'.$CELL_TEXT_SIZE.'px" color="'.$CELL_TEXT_CLR.'" face="'.$CELL_TEXT_FONT.'"><'.$CELL_TEXT_STYLE.'>'.$cart[PRODUCTCODE][$i].'</'.$CELL_TEXT_STYLE.'></font></td>';
$strHTML .= '<td align="left" bgcolor="'.$BGCOLOR.'"><font style="font-size:'.$CELL_TEXT_SIZE.'px" color="'.$CELL_TEXT_CLR.'" face="'.$CELL_TEXT_FONT.'"><'.$CELL_TEXT_STYLE.'>'.$cart[PRODUCTNAME][$i].'</'.$CELL_TEXT_STYLE.'></font></td>';
$strHTML .= '<td align="center" bgcolor="'.$BGCOLOR.'"><input type="text" name="quantity'.($i).'" style="text-align:right;width:40px;font-family:'.$CELL_TEXT_FONT.';font-size:'.$CELL_TEXT_SIZE.'px" align="right" value="'.$cart[QUANTITY][$i].'" size="1"></td>';
$strHTML .= '<td align="center" bgcolor="'.$BGCOLOR.'"><font style="font-size:'.$CELL_TEXT_SIZE.'px" color="'.$CELL_TEXT_CLR.'" face="'.$CELL_TEXT_FONT.'"><'.$CELL_TEXT_STYLE.'>'.number_format($cart[PRICE][$i],2).'</'.$CELL_TEXT_STYLE.'></font></td>';
$strHTML .= '<td align="right" bgcolor="'.$BGCOLOR.'"><font style="font-size:'.$CELL_TEXT_SIZE.'px" color="'.$CELL_TEXT_CLR.'" face="'.$CELL_TEXT_FONT.'"><'.$CELL_TEXT_STYLE.'>'.number_format($cart[PRICE][$i]*$cart[QUANTITY][$i],2).'</'.$CELL_TEXT_STYLE.'></font></td>';
$strHTML .= '</tr>';
$subtotal = $subtotal + ($cart[PRICE][$i]*$cart[QUANTITY][$i]);
$total_weight += $cart[WEIGHT][$i]*$cart[QUANTITY][$i];
// Let's see what the actual per item shipping cost is
$item_shipping = explode(",", $cart[SHIPPING][$i]);
for ($k = 0; $k <= 3; $k++){
if ($item_shipping[4-$k] <= 0) {
$item_shipping[4-$k] = $item_shipping[4-$k -1];
}
}
$real_shipping = $item_shipping[$ship_area];
$total_per_item_shipping += $real_shipping * $cart[QUANTITY][$i];
// Calculate Tax for the specific product
$tax[1] = $GLOBALS['tax_percent1'];
$tax[2] = $GLOBALS['tax_percent2'];
$tax[3] = $GLOBALS['tax_percent3'];
$tax[4] = $GLOBALS['tax_percent4'];
if ($tax_type == "per_item") {
$taxes = $taxes + $cart[PRICE][$i] * $cart[QUANTITY][$i] * $tax[$cart[TAX][$i]]/100;
}
}
if ($tax_type == "unique" or ($tax_type == "state_only" and $resident == "Yes")) {
$taxes = $subtotal * $unique_tax_percent / 100;
}
$nettotal = $subtotal - $discount;
if ($shipping_type == "per_item") {
$shipping2 = $total_per_item_shipping;
}
// Define flat rate shipping charges
for ($i = 1; $i <=8; $i++){
if ($shipping_type == "flat_rate") {
if (number_format($nettotal,2) > $sh2_low[$i] and number_format($nettotal, 2) <= $sh2_hi[$i]) {
$shipping2 = $sh2[$ship_area][$i];
}
}
}
// Define per weight shipping charges
for ($i = 1; $i <=8; $i++){
if ($shipping_type == "per_weight") {
if (number_format($total_weight, 2) >= $sh2_w_low[$i] and number_format($total_weight,2) <= $sh2_w_hi[$i]) {
$shipping2 = $sh2_w[$ship_area][$i];
}
}
}
$shipping_total = $shipping1 + $shipping2 + $handling;
if(is_numeric($free_shipping_over) and $free_shipping_over > 0 and $nettotal > $free_shipping_over){
$shipping_total = 0;
$handling = 0;
$shipping1 = 0;
$shipping2 = 0;
}
$grandtotal = $nettotal + $taxes + $shipping_total;
$_SESSION['subtotal'] = $subtotal;
$_SESSION['discount'] = $discount;
$_SESSION['nettotal'] = $nettotal;
$_SESSION['taxes'] = $taxes;
$_SESSION['handling'] = $handling;
$_SESSION['shipping1'] = $shipping1 + $shipping2;
$_SESSION['shipping'] = $shipping_total;
$_SESSION['grandtotal'] = $grandtotal;
// Display Subtotal
if($discount > 0 or $taxes > 0 or $shipping > 0){
$strHTML .= '<tr>';
$strHTML .= '<td></td><td></td>';
$strHTML .= '<td colspan="2" align="left" bgcolor="'.$TOTALS_BCGRD_CLR.'"><font style="font-size:'.$TOTALS_TEXT_SIZE.'px" color="'.$TOTALS_TEXT_CLR.'" face="'.$TOTALS_TEXT_FONT.'"><'.$TOTALS_TEXT_STYLE.'>'.$subtotal_label.', '.$currency_symbol.':</'.$TOTALS_TEXT_STYLE.'></font></td>';
$strHTML .= '<td align="right" bgcolor="'.$TOTALS_BCGRD_CLR.'"><font style="font-size:'.$TOTALS_TEXT_SIZE.'px" color="'.$TOTALS_TEXT_CLR.'" face="'.$TOTALS_TEXT_FONT.'"><'.$TOTALS_TEXT_STYLE.'>'.number_format($subtotal, 2).'</'.$TOTALS_TEXT_STYLE.'></font></td>';
$strHTML .= '</tr>';
}
// Display Promo discount
if($discount > 0){
$strHTML .= '<tr>';
$strHTML .= '<td></td><td></td>';
$strHTML .= '<td colspan="2" align="left" bgcolor="'.$TOTALS_BCGRD_CLR.'"><font style="font-size:'.$TOTALS_TEXT_SIZE.'px" color="'.$TOTALS_TEXT_CLR.'" face="'.$TOTALS_TEXT_FONT.'"><'.$TOTALS_TEXT_STYLE.'>'.$discount_label.', '.$currency_symbol.':</'.$TOTALS_TEXT_STYLE.'></font></td>';
$strHTML .= '<td align="right" bgcolor="'.$TOTALS_BCGRD_CLR.'"><font style="font-size:'.$TOTALS_TEXT_SIZE.'px" color="'.$TOTALS_TEXT_CLR.'" face="'.$TOTALS_TEXT_FONT.'"><'.$TOTALS_TEXT_STYLE.'>-'.number_format($discount, 2).'</'.$TOTALS_TEXT_STYLE.'></font></td>';
$strHTML .= '</tr>';
// Display Nettotal
$strHTML .= '<tr>';
$strHTML .= '<td></td><td></td>';
$strHTML .= '<td colspan="2" align="left" bgcolor="'.$TOTALS_BCGRD_CLR.'"><font style="font-size:'.$TOTALS_TEXT_SIZE.'px" color="'.$TOTALS_TEXT_CLR.'" face="'.$TOTALS_TEXT_FONT.'"><'.$TOTALS_TEXT_STYLE.'>'.$nettotal_label.', '.$currency_symbol.':</'.$TOTALS_TEXT_STYLE.'></font></td>';
$strHTML .= '<td align="right" bgcolor="'.$TOTALS_BCGRD_CLR.'"><font style="font-size:'.$TOTALS_TEXT_SIZE.'px" color="'.$TOTALS_TEXT_CLR.'" face="'.$TOTALS_TEXT_FONT.'"><'.$TOTALS_TEXT_STYLE.'>'.number_format($nettotal, 2).'</'.$TOTALS_TEXT_STYLE.'></font></td>';
$strHTML .= '</tr>';
}
// Display Taxes
if($taxes > 0){
$strHTML .= '<tr>';
$strHTML .= '<td></td><td></td>';
$strHTML .= '<td colspan="2" align="left" bgcolor="'.$TOTALS_BCGRD_CLR.'"><font style="font-size:'.$TOTALS_TEXT_SIZE.'px" color="'.$TOTALS_TEXT_CLR.'" face="'.$TOTALS_TEXT_FONT.'"><'.$TOTALS_TEXT_STYLE.'>'.$taxes_label.', '.$currency_symbol.':</'.$TOTALS_TEXT_STYLE.'></font></td>';
$strHTML .= '<td align="right" bgcolor="'.$TOTALS_BCGRD_CLR.'"><font style="font-size:'.$TOTALS_TEXT_SIZE.'px" color="'.$TOTALS_TEXT_CLR.'" face="'.$TOTALS_TEXT_FONT.'"><'.$TOTALS_TEXT_STYLE.'>'.number_format($taxes, 2).'</'.$TOTALS_TEXT_STYLE.'></font></td>';
$strHTML .= '</tr>';
}
// Display Shipping
if($shipping_total > 0){
$strHTML .= '<tr>';
$strHTML .= '<td></td><td></td>';
$strHTML .= '<td colspan="2" align="left" bgcolor="'.$TOTALS_BCGRD_CLR.'"><font style="font-size:'.$TOTALS_TEXT_SIZE.'px" color="'.$TOTALS_TEXT_CLR.'" face="'.$TOTALS_TEXT_FONT.'"><'.$TOTALS_TEXT_STYLE.'>'.$shipping_label.', '.$currency_symbol.':</'.$TOTALS_TEXT_STYLE.'></font></td>';
$strHTML .= '<td align="right" bgcolor="'.$TOTALS_BCGRD_CLR.'"><font style="font-size:'.$TOTALS_TEXT_SIZE.'px" color="'.$TOTALS_TEXT_CLR.'" face="'.$TOTALS_TEXT_FONT.'"><'.$TOTALS_TEXT_STYLE.'>'.number_format($shipping_total, 2).'</'.$TOTALS_TEXT_STYLE.'></font></td>';
$strHTML .= '</tr>';
$strHTML .= '<tr>';
}
// Display Grandtotal
$strHTML .= '<td></td><td></td>';
$strHTML .= '<td colspan="2" align="left" bgcolor="'.$TOTALS_BCGRD_CLR.'"><font style="font-size:'.$TOTALS_TEXT_SIZE.'px" color="'.$TOTALS_TEXT_CLR.'" face="'.$TOTALS_TEXT_FONT.'"><'.$TOTALS_TEXT_STYLE.'>'.$grandtotal_label.', '.$currency_symbol.':</'.$TOTALS_TEXT_STYLE.'></font></td>';
$strHTML .= '<td align="right" bgcolor="'.$TOTALS_BCGRD_CLR.'"><font style="font-size:'.$TOTALS_TEXT_SIZE.'px" color="'.$TOTALS_TEXT_CLR.'" face="'.$TOTALS_TEXT_FONT.'"><'.$TOTALS_TEXT_STYLE.'>'.number_format($grandtotal, 2).'</'.$TOTALS_TEXT_STYLE.'></font></td>';
$strHTML .= '</tr>';
$strHTML .= '</table>';
$strHTML .= '</div>';
}
echo $strHTML;
?>
Код страницы cart.php:
<?php
session_start();
ini_set('display_errors', 1);
error_reporting(0);
require_once 'admin/config.php';
require_once 'admin/paypal_settings.php';
require_once 'admin/shipping_settings.php';
require_once 'admin/shipto_countries.php';
define("PRODUCTCODE", 0);
define("PRODUCTNAME", 1);
define("QUANTITY", 2);
define("PRICE", 3);
define("TAX", 4);
define("WEIGHT", 5);
define("SHIPPING", 6);
if(trim($_SESSION['ship_to_country']) == ""){
$_SESSION['ship_to_country'] = $origin_country;
}
$ship_to_country = $_SESSION['ship_to_country'];
if (trim($_REQUEST['ship_to_country']) != ""){
$ship_to_country = $_REQUEST['ship_to_country'];
$_SESSION['ship_to_country'] = $_REQUEST['ship_to_country'];
}
$shiptocountry = str_replace("_", " ", $ship_to_country);
$resident = $_SESSION['resident'] ;
if($_POST['resident'] != ""){
$_SESSION['resident'] = $_POST['resident'];
$resident = $_SESSION['resident'];
}
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
if(file_exists('admin/shipto_countries.php')){
include 'admin/shipto_countries.php';
}
if (isset($_POST['productcode']))
{
AddToCart();
}
else
{
$action = isset($_POST['action']) ? $_POST['action'] : '';
$value = trim($action);
switch ($value)
{
// continue shopping
case $continue_label:
header("Location: ".$shopping_url);
break;
// recalculate
case $recalculate_label:
RecalculateCart();
break;
// proceed to checkout
case $checkout_label:
header("Location: ".$cart_redirect);
break;
}
}
}
function AddToCart()
{
$cart = isset($_SESSION['cart']) ? $_SESSION['cart'] : '';
$itemcount = isset($_SESSION['itemcount']) ? $_SESSION['itemcount'] : 0;
$productname = $_POST['productname'];
$extra_price = 0;
for ($opt = 1; $opt <= 8; $opt++){
$key = 'option_name'.$opt;
$key1 = 'option_values'.$opt;
$option_name = trim($_POST[$key]);
$option_value = trim($_POST[$key1]);
if ($option_value != "") {
unset($options);
$options = explode(",", $option_value);
$productname .= " / $option_name : ".$options[0];
$extra_price = $extra_price + $options[1];
}
}
$productname = stripslashes($productname);
// Let's see if this product already exists
for ($i=0; $i < $itemcount; $i++)
{
if ($cart[PRODUCTNAME][$i] == $productname) {
$cart[QUANTITY][$i] = $cart[QUANTITY][$i] + intval($_POST['quantity']);
$_SESSION['cart'] = $cart;
$_SESSION['itemcount'] = $itemcount;
header("Location: "."cart.php");
exit;
}
}
$cart[PRODUCTCODE][$itemcount] = $_POST['productcode'];
$cart[PRODUCTNAME][$itemcount] = stripslashes($productname);
$cart[QUANTITY][$itemcount] = intval($_POST['quantity']);
$cart[PRICE][$itemcount] = $_POST['price'] + $extra_price;
$cart[TAX][$itemcount] = $_POST['taxid'];
$cart[WEIGHT][$itemcount] = $_POST['weight'];
$cart[SHIPPING][$itemcount] = $_POST['shipping'];
$itemcount = $itemcount + 1;
$_SESSION['cart'] = $cart;
$_SESSION['itemcount'] = $itemcount;
}
function RecalculateCart()
{
include 'admin/config.php';
$cart = isset($_SESSION['cart']) ? $_SESSION['cart'] : '';
$itemcount = isset($_SESSION['itemcount']) ? $_SESSION['itemcount'] : 0;
for ($i=0; $i<$itemcount; $i++)
{
$quantity = $_POST['quantity'.($i)];
if (empty($quantity))
{
$quantity = 0;
}
else
if (($quantity <= 0) || (!is_numeric($quantity)))
{
$quantity = 0;
}
$cart[QUANTITY][$i] = intval($quantity);
}
for ($j=0; $j<$itemcount; $j++)
{
$quantity = $cart[QUANTITY][$j];
// remove item from the cart
if ($quantity == 0)
{
$itemcount--;
$curitem = $j;
while(($curitem+1) < count($cart[0]))
{
for ($k=0; $k<7; $k++)
{
$cart[$k][$curitem] = $cart[$k][$curitem+1];
$cart[$k][$curitem+1] = '';
}
$curitem++;
}
}
}
$_SESSION['itemcount'] = $itemcount;
$_SESSION['cart'] = $cart;
$promo_code = trim($_POST['promo_code']);
$_SESSION["promo_code"] = "";
$_SESSION["discount"] = "";
// Find out if a promo code is entered
$promo_codes = array_keys($promo_value);
if ($promo_code != "" and in_array($promo_code, $promo_codes)) {
// Check Dates if($promo_start[$promo_code] > date("Y-m-d") or $promo_end[$promo_code] < date("Y-m-d")){
$_SESSION['promo_code'] = "";
$_SESSION['discount'] = "";
header("Location: "."error.php?msg=".rawurlencode($coupon_expired_label));
exit;
}
$_SESSION['promo_code'] = $promo_code;
$discount = $promo_value[$promo_code];
$order_min = $promo_min[$promo_code];
// Check if order is higher than the min required for this promo code
for ($i=0; $i<$itemcount; $i++)
{
$subtotal = $subtotal + ($cart[PRICE][$i]*$cart[QUANTITY][$i]);
}
if($promo_type[$promo_code] == "%"){
$discount = $promo_value[$promo_code]*$subtotal/100;
}
$_SESSION['discount'] = $discount;
if ($subtotal < $order_min){
$_SESSION['promo_code'] = "";
$_SESSION['discount'] = "";
header("Location: "."error.php?msg=".rawurlencode($no_discount_label));
exit;
}
}
else {
if ($promo_code != "" and (!in_array(trim($_POST['promo_code']), $promo_codes))){
$_SESSION['promo_code'] = "";
$_SESSION['discount'] = "";
header("Location: "."error.php?msg=".rawurlencode($coupon_expired_label));
exit;
}
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Shopping Cart</title>
<meta name="description" content="A free but powerfull and flexible Shopping Cart Script developed for WYSIWYG Web builder users">
<meta name="author" content="Pablo Software Solution - DBTechnosystems">
<meta name="generator" content="WYSIWYG Web Builder -
http://www.wysiwygwebbuilder.com">
<style type="text/css">
div#container
{
width: 780px;
position: relative;
margin-top: 0px;
margin-left: auto;
margin-right: auto;
text-align: left;
}
body
{
text-align: center;
margin: 0;
background-color: #E6E6E6;
color: #000000;
}
</style>
<style type="text/css">
a
{
color: #0000FF;
text-decoration: underline;
}
a:visited
{
color: #800080;
}
a:active
{
color: #FF0000;
}
a:hover
{
color: #0000FF;
text-decoration: underline;
}
a.oil_text
{
color: #444310;
text-decoration: underline;
}
a.oil_text:visited
{
color: #444310;
text-decoration: underline;
}
a.oil_text:active
{
color: #444310;
text-decoration: underline;
}
a.oil_text:hover
{
color: #444310;
font-weight: bold;
text-decoration: underline;
}
</style>
<style type="text/css">
#Image2
{
border: 0px #000000 solid;
}
#Image1
{
border: 0px #000000 solid;
}
#Image4
{
border: 0px #000000 solid;
}
#Image3
{
border: 0px #000000 solid;
}
#wb_Text2
{
background-color: transparent;
border: 0px #000000 none;
padding: 0;
text-align: left;
}
#wb_Text2 div
{
text-align: left;
}
#wb_Form2
{
background-color: transparent;
border: 0px #000000 dotted;
}
#Button2
{
color: #000000;
font-family: Arial;
font-size: 13px;
}
#Button1
{
color: #000000;
font-family: Arial;
font-size: 13px;
}
#Button4
{
color: #000000;
font-family: Arial;
font-size: 13px;
}
#NavigationBar1 ul.navbar
{
list-style: none;
margin: 0;
padding: 0;
}
#NavigationBar1 ul.navbar li
{
height: 30px;
width: 131px;
margin: 0px 0px 0px 0px;
vertical-align: bottom;
}
#NavigationBar1 ul.navbar li a
{
display: block;
position: relative;
}
#NavigationBar1 ul.navbar li a img
{
position: absolute;
z-index: 1;
border-width: 0px;
}
#NavigationBar1 ul.navbar li span
{
display: block;
height: 30px;
width: 131px;
position: absolute;
z-index: 2;
}
#NavigationBar1 a .hover
{
visibility: hidden;
}
#NavigationBar1 a:hover .hover
{
visibility: visible;
}
#NavigationBar1 a:hover span
{
visibility: hidden;
}
#wb_Text3
{
background-color: transparent;
border: 0px #000000 none;
padding: 0;
text-align: left;
}
#wb_Text3 div
{
text-align: left;
}
#Editbox1
{
border: 1px #000000 solid;
background-color: #FFFFFF;
color :#000000;
font-family: Arial;
font-size: 13px;
text-align: left;
vertical-align: middle;
}
#wb_Text1
{
background-color: transparent;
border: 0px #000000 none;
padding: 0;text-align: right;
}
#wb_Text1 div
{
text-align: right;
}
#wb_Text5
{
background-color: transparent;
border: 0px #000000 none;
padding: 0;
text-align: left;
}
#wb_Text5 div
{
text-align: left;
}
#wb_Text6
{
background-color: transparent;
border: 0px #000000 none;
padding: 0;
text-align: center;
}
#wb_Text6 div
{
text-align: center;
}
#wb_Text7
{
background-color: transparent;
border: 0px #000000 none;
padding: 0;
text-align: justify;
}
#wb_Text7 div
{
text-align: justify;
}
#country_list
{
border: 1px #C0C0C0 solid;
background-color: #FFFFFF;
color: #000000;
font-family: Arial;
font-size: 12px;
}
#wb_Text8
{
background-color: transparent;
border: 0px #000000 solid;
padding: 0;
text-align: left;
}
#wb_Text8 div
{
text-align: left;
}
#wb_Text9
{
background-color: transparent;
border: 0px #000000 none;
padding: 0;
text-align: justify;
}
#wb_Text9 div
{
text-align: justify;
}
#wb_Text10
{
background-color: transparent;
border: 0px #000000 none;
padding: 0;
text-align: justify;
}
#wb_Text10 div
{
text-align: justify;
}
#wb_Text4
{
background-color: transparent;
border: 0px #000000 none;
padding: 0;
text-align: justify;
}
#wb_Text4 div
{
text-align: justify;
}
</style>
<script type="text/javascript" src="wwb9.min.js"></script>
<script type="text/javascript">
<!--
function recalculate(sel)
{
var name = sel.name;
var location = 'cart.php?ship_to_country='+sel.options[sel.selectedIndex].value;
window.location = location;
}
//-->
</script>
</head>
<body>
<div id="container">
<div id="wb_Image2" style="position:absolute;left:0px;top:613px;width:780px;height:92px;z-index:12;">
<img src="images/footer.gif" id="Image2" alt="" style="width:780px;height:92px;"></div>
<div id="wb_Image1" style="position:absolute;left:0px;top:21px;width:780px;height:87px;z-index:13;">
<img src="images/header.gif" id="Image1" alt="" style="width:780px;height:87px;"></div>
<div id="wb_Image4" style="position:absolute;left:0px;top:108px;width:780px;height:507px;z-index:14;">
<img src="images/body.gif" id="Image4" alt="" style="width:780px;height:507px;"></div>
<div id="wb_Image3" style="position:absolute;left:31px;top:102px;width:719px;height:13px;z-index:15;">
<img src="images/banner-background.gif" id="Image3" alt="" style="width:719px;height:13px;"></div>
<div id="wb_Text2" style="position:absolute;left:31px;top:49px;width:485px;height:32px;z-index:16;text-align:left;">
<span style="color:#497DB2;font-family:Tahoma;font-size:27px;">Your Shopping Cart</span></div>
<div id="wb_Form2" style="position:absolute;left:173px;top:122px;width:594px;height:556px;z-index:17;">
<form name="frmCart" method="post" action="cart.php" accept-charset="UTF-8" id="Form2">
<input type="hidden" name="resident" value="No">
<input type="submit" id="Button1" name="action" value="Recalculate" style="position:absolute;left:424px;top:505px;width:80px;height:25px;z-index:0;">
<input type="submit" id="Button4" name="action" value="Check out" style="position:absolute;left:508px;top:505px;width:82px;height:25px;z-index:1;">
<input type="text" id="Editbox1" style="position:absolute;left:341px;top:367px;width:80px;height:20px;line-height:20px;z-index:2;" name="promo_code" value="<? echo stripslashes($_SESSION['promo_code']);?>">
<input type="submit" id="Button2" name="action" value="Continue Shopping" style="position:absolute;left:4px;top:505px;width:136px;height:25px;z-index:3;">
<div id="wb_Text3" style="position:absolute;left:19px;top:534px;width:514px;height:16px;z-index:4;text-align:left;">
<span style="color:#00008B;font-family:Arial;font-size:13px;"><strong>Tip</strong></span><span style="color:#000000;font-family:Arial;font-size:13px;">: To delete a product, change the quantity to be "0" and press "Recalculate".</span></div>
<div id="wb_Text7" style="position:absolute;left:5px;top:403px;width:324px;height:45px;text-align:justify;z-index:5;">
<?
echo'<spanstyle="color:#A52A00;font-family:Arial;font-size:12px;">Shipping costs are calculated for '.$shiptocountry.'. To correctly calculate shipping charges, if different, please select your delivery country hereby.</span>';
?></div>
<select name="ship_to_country" size="1" id="country_list" onchange="recalculate(this);return false;" style="position:absolute;left:341px;top:404px;width:247px;height:21px;z-index:6;" ><?
$countries = array_keys($area);
echo '<option value="">Please select</option>
';
for ($i = 0; $i < count($countries); $i++){
if ($area[$countries[$i]] != "" and $area[$countries[$i]] != "-") {
$countries[$i] = str_replace("_", " ", $countries[$i]);
echo '<option ';
if ($shiptocountry == $countries[$i]) {
echo 'selected ';
}
echo 'value="'.$countries[$i].'">'.$countries[$i].'</option>
';
}
}
?>
</select>
<!-- Shopping Cart contents —>
<div id="Html1" style="position:absolute;left:1px;top:2px;width:586px;height:352px;z-index:7">
<?php
$cart = isset($_SESSION['cart']) ? $_SESSION['cart'] : '';
$itemcount = isset($_SESSION['itemcount']) ? $_SESSION['itemcount'] : 0;
$strHTML = "";
if ($itemcount == 0)
{
$strHTML = "<h3>".$empty_cart_label."</h3>";
}
else
{
$strHTML = '<div style="overflow:auto; height:100%;">';
$strHTML .= '<table border="0" cellpadding="3" cellspacing="2" width="100%">';
$strHTML .= '<tr>';
$strHTML .= '<td align="center" bgcolor="'.$TITLE_BCGRD_CLR.'"><font style="font-size:'.$TITLE_TEXT_SIZE.'px" color="'.$TITLE_TEXT_CLR.'" face="'.$TITLE_TEXT_FONT.'"><'.$TITLE_TEXT_STYLE.'>'.$product_code_label.'</'.$TITLE_TEXT_STYLE.'></font></td>';
$strHTML .= '<td align="center" bgcolor="'.$TITLE_BCGRD_CLR.'"><font style="font-size:'.$TITLE_TEXT_SIZE.'px" color="'.$TITLE_TEXT_CLR.'" face="'.$TITLE_TEXT_FONT.'"><'.$TITLE_TEXT_STYLE.'>'.$product_description_label.'</'.$TITLE_TEXT_STYLE.'></font></td>';
$strHTML .= '<td align="center" bgcolor="'.$TITLE_BCGRD_CLR.'"><font style="font-size:'.$TITLE_TEXT_SIZE.'px" color="'.$TITLE_TEXT_CLR.'" face="'.$TITLE_TEXT_FONT.'"><'.$TITLE_TEXT_STYLE.'>'.$product_qty_label.'</'.$TITLE_TEXT_STYLE.'></font></td>';
$strHTML .= '<td align="center" bgcolor="'.$TITLE_BCGRD_CLR.'"><font style="font-size:'.$TITLE_TEXT_SIZE.'px" color="'.$TITLE_TEXT_CLR.'" face="'.$TITLE_TEXT_FONT.'"><'.$TITLE_TEXT_STYLE.'>'.$product_price_label.' '.$currency_symbol.'</'.$TITLE_TEXT_STYLE.'></font></td>';
$strHTML .= '<td align="center" bgcolor="'.$TITLE_BCGRD_CLR.'"><font style="font-size:'.$TITLE_TEXT_SIZE.'px" color="'.$TITLE_TEXT_CLR.'" face="'.$TITLE_TEXT_FONT.'"><'.$TITLE_TEXT_STYLE.'>'.$product_amount_label.' '.$currency_symbol.'</'.$TITLE_TEXT_STYLE.'></font></td>';
$subtotal = 0;
$taxes = 0;
$discount = $_SESSION['discount'];
$total = 0;
$shipping = 0;
//$ship_to_country = isset($ship_to_country)? $ship_to_country : str_replace(" ", "_", $origin_country); // it sets the area to National if it is not defined
$ship_area = isset($ship_to_country)? $area[str_replace(" ", "_", $ship_to_country)]:'0'; // it sets the area to National if it is not defined
for ($i=0; $i<$itemcount; $i++)
{
$BGCOLOR=$BGCOLOR1;
if ($i % 2 == 0) {
$BGCOLOR=$BGCOLOR2;
}
$strHTML .= '<tr>';
$strHTML .= '<td align="center" bgcolor="'.$BGCOLOR.'"><font style="font-size:'.$CELL_TEXT_SIZE.'px" color="'.$CELL_TEXT_CLR.'" face="'.$CELL_TEXT_FONT.'"><'.$CELL_TEXT_STYLE.'>'.$cart[PRODUCTCODE][$i].'</'.$CELL_TEXT_STYLE.'></font></td>';
$strHTML .= '<td align="left" bgcolor="'.$BGCOLOR.'"><font style="font-size:'.$CELL_TEXT_SIZE.'px" color="'.$CELL_TEXT_CLR.'" face="'.$CELL_TEXT_FONT.'"><'.$CELL_TEXT_STYLE.'>'.$cart[PRODUCTNAME][$i].'</'.$CELL_TEXT_STYLE.'></font></td>';
$strHTML .= '<td align="center" bgcolor="'.$BGCOLOR.'"><input type="text" name="quantity'.($i).'" style="text-align:right;width:40px;font-family:'.$CELL_TEXT_FONT.';font-size:'.$CELL_TEXT_SIZE.'px" align="right" value="'.$cart[QUANTITY][$i].'" size="1"></td>';
$strHTML .= '<td align="center" bgcolor="'.$BGCOLOR.'"><font style="font-size:'.$CELL_TEXT_SIZE.'px" color="'.$CELL_TEXT_CLR.'" face="'.$CELL_TEXT_FONT.'"><'.$CELL_TEXT_STYLE.'>'.number_format($cart[PRICE][$i],2).'</'.$CELL_TEXT_STYLE.'></font></td>';
$strHTML .= '<td align="right" bgcolor="'.$BGCOLOR.'"><font style="font-size:'.$CELL_TEXT_SIZE.'px" color="'.$CELL_TEXT_CLR.'" face="'.$CELL_TEXT_FONT.'"><'.$CELL_TEXT_STYLE.'>'.number_format($cart[PRICE][$i]*$cart[QUANTITY][$i],2).'</'.$CELL_TEXT_STYLE.'></font></td>';
$strHTML .= '</tr>';
$subtotal = $subtotal + ($cart[PRICE][$i]*$cart[QUANTITY][$i]);
$total_weight += $cart[WEIGHT][$i]*$cart[QUANTITY][$i];
// Let's see what the actual per item shipping cost is
$item_shipping = explode(",", $cart[SHIPPING][$i]);
for ($k = 0; $k <= 3; $k++){
if ($item_shipping[4-$k] <= 0) {
$item_shipping[4-$k] = $item_shipping[4-$k -1];
}
}
$real_shipping = $item_shipping[$ship_area];
$total_per_item_shipping += $real_shipping * $cart[QUANTITY][$i];
// Calculate Tax for the specific product
$tax[1] = $GLOBALS['tax_percent1'];
$tax[2] = $GLOBALS['tax_percent2'];
$tax[3] = $GLOBALS['tax_percent3'];
$tax[4] = $GLOBALS['tax_percent4'];
if ($tax_type == "per_item") {
$taxes = $taxes + $cart[PRICE][$i] * $cart[QUANTITY][$i] * $tax[$cart[TAX][$i]]/100;
}
}
if ($tax_type == "unique" or ($tax_type == "state_only" and $resident == "Yes")) {
$taxes = $subtotal * $unique_tax_percent / 100;
}
$nettotal = $subtotal - $discount;
if ($shipping_type == "per_item") {
$shipping2 = $total_per_item_shipping;
}
// Define flat rate shipping charges
for ($i = 1; $i <=8; $i++){
if ($shipping_type == "flat_rate") {
if (number_format($nettotal,2) > $sh2_low[$i] and number_format($nettotal, 2) <= $sh2_hi[$i]) {
$shipping2 = $sh2[$ship_area][$i];
}
}
}
// Define per weight shipping charges
for ($i = 1; $i <=8; $i++){
if ($shipping_type == "per_weight") {
if (number_format($total_weight, 2) >= $sh2_w_low[$i] and number_format($total_weight,2) <= $sh2_w_hi[$i]) {
$shipping2 = $sh2_w[$ship_area][$i];
}
}
}
$shipping_total = $shipping1 + $shipping2 + $handling;
if(is_numeric($free_shipping_over) and $free_shipping_over > 0 and $nettotal > $free_shipping_over){
$shipping_total = 0;
$handling = 0;
$shipping1 = 0;
$shipping2 = 0;
}
$grandtotal = $nettotal + $taxes + $shipping_total;
$_SESSION['subtotal'] = $subtotal;
$_SESSION['discount'] = $discount;
$_SESSION['nettotal'] = $nettotal;
$_SESSION['taxes'] = $taxes;
$_SESSION['handling'] = $handling;
$_SESSION['shipping1'] = $shipping1 + $shipping2;
$_SESSION['shipping'] = $shipping_total;
$_SESSION['grandtotal'] = $grandtotal;
// Display Subtotal
if($discount > 0 or $taxes > 0 or $shipping > 0){
$strHTML .= '<tr>';
$strHTML .= '<td></td><td></td>';
$strHTML .= '<td colspan="2" align="left" bgcolor="'.$TOTALS_BCGRD_CLR.'"><font style="font-size:'.$TOTALS_TEXT_SIZE.'px" color="'.$TOTALS_TEXT_CLR.'" face="'.$TOTALS_TEXT_FONT.'"><'.$TOTALS_TEXT_STYLE.'>'.$subtotal_label.', '.$currency_symbol.':</'.$TOTALS_TEXT_STYLE.'></font></td>';
$strHTML .= '<td align="right" bgcolor="'.$TOTALS_BCGRD_CLR.'"><font style="font-size:'.$TOTALS_TEXT_SIZE.'px" color="'.$TOTALS_TEXT_CLR.'" face="'.$TOTALS_TEXT_FONT.'"><'.$TOTALS_TEXT_STYLE.'>'.number_format($subtotal, 2).'</'.$TOTALS_TEXT_STYLE.'></font></td>';
$strHTML .= '</tr>';
}
// Display Promo discount
if($discount > 0){
$strHTML .= '<tr>';
$strHTML .= '<td></td><td></td>';
$strHTML .= '<td colspan="2" align="left" bgcolor="'.$TOTALS_BCGRD_CLR.'"><font style="font-size:'.$TOTALS_TEXT_SIZE.'px" color="'.$TOTALS_TEXT_CLR.'" face="'.$TOTALS_TEXT_FONT.'"><'.$TOTALS_TEXT_STYLE.'>'.$discount_label.', '.$currency_symbol.':</'.$TOTALS_TEXT_STYLE.'></font></td>';
$strHTML .= '<td align="right" bgcolor="'.$TOTALS_BCGRD_CLR.'"><font style="font-size:'.$TOTALS_TEXT_SIZE.'px" color="'.$TOTALS_TEXT_CLR.'" face="'.$TOTALS_TEXT_FONT.'"><'.$TOTALS_TEXT_STYLE.'>-'.number_format($discount, 2).'</'.$TOTALS_TEXT_STYLE.'></font></td>';
$strHTML .= '</tr>';
// Display Nettotal
$strHTML .= '<tr>';
$strHTML .= '<td></td><td></td>';
$strHTML .= '<td colspan="2" align="left" bgcolor="'.$TOTALS_BCGRD_CLR.'"><font style="font-size:'.$TOTALS_TEXT_SIZE.'px" color="'.$TOTALS_TEXT_CLR.'" face="'.$TOTALS_TEXT_FONT.'"><'.$TOTALS_TEXT_STYLE.'>'.$nettotal_label.', '.$currency_symbol.':</'.$TOTALS_TEXT_STYLE.'></font></td>';
$strHTML .= '<td align="right" bgcolor="'.$TOTALS_BCGRD_CLR.'"><font style="font-size:'.$TOTALS_TEXT_SIZE.'px" color="'.$TOTALS_TEXT_CLR.'" face="'.$TOTALS_TEXT_FONT.'"><'.$TOTALS_TEXT_STYLE.'>'.number_format($nettotal, 2).'</'.$TOTALS_TEXT_STYLE.'></font></td>';
$strHTML .= '</tr>';
}
// Display Taxes
if($taxes > 0){
$strHTML .= '<tr>';
$strHTML .= '<td></td><td></td>';
$strHTML .= '<td colspan="2" align="left" bgcolor="'.$TOTALS_BCGRD_CLR.'"><font style="font-size:'.$TOTALS_TEXT_SIZE.'px" color="'.$TOTALS_TEXT_CLR.'" face="'.$TOTALS_TEXT_FONT.'"><'.$TOTALS_TEXT_STYLE.'>'.$taxes_label.', '.$currency_symbol.':</'.$TOTALS_TEXT_STYLE.'></font></td>';
$strHTML .= '<td align="right" bgcolor="'.$TOTALS_BCGRD_CLR.'"><font style="font-size:'.$TOTALS_TEXT_SIZE.'px" color="'.$TOTALS_TEXT_CLR.'" face="'.$TOTALS_TEXT_FONT.'"><'.$TOTALS_TEXT_STYLE.'>'.number_format($taxes, 2).'</'.$TOTALS_TEXT_STYLE.'></font></td>';
$strHTML .= '</tr>';
}
// Display Shipping
if($shipping_total > 0){
$strHTML .= '<tr>';
$strHTML .= '<td></td><td></td>';
$strHTML .= '<td colspan="2" align="left" bgcolor="'.$TOTALS_BCGRD_CLR.'"><font style="font-size:'.$TOTALS_TEXT_SIZE.'px" color="'.$TOTALS_TEXT_CLR.'" face="'.$TOTALS_TEXT_FONT.'"><'.$TOTALS_TEXT_STYLE.'>'.$shipping_label.', '.$currency_symbol.':</'.$TOTALS_TEXT_STYLE.'></font></td>';
$strHTML .= '<td align="right" bgcolor="'.$TOTALS_BCGRD_CLR.'"><font style="font-size:'.$TOTALS_TEXT_SIZE.'px" color="'.$TOTALS_TEXT_CLR.'" face="'.$TOTALS_TEXT_FONT.'"><'.$TOTALS_TEXT_STYLE.'>'.number_format($shipping_total, 2).'</'.$TOTALS_TEXT_STYLE.'></font></td>';
$strHTML .= '</tr>';
$strHTML .= '<tr>';
}
// Display Grandtotal
$strHTML .= '<td></td><td></td>';
$strHTML .= '<td colspan="2" align="left" bgcolor="'.$TOTALS_BCGRD_CLR.'"><font style="font-size:'.$TOTALS_TEXT_SIZE.'px" color="'.$TOTALS_TEXT_CLR.'" face="'.$TOTALS_TEXT_FONT.'"><'.$TOTALS_TEXT_STYLE.'>'.$grandtotal_label.', '.$currency_symbol.':</'.$TOTALS_TEXT_STYLE.'></font></td>';
$strHTML .= '<td align="right" bgcolor="'.$TOTALS_BCGRD_CLR.'"><font style="font-size:'.$TOTALS_TEXT_SIZE.'px" color="'.$TOTALS_TEXT_CLR.'" face="'.$TOTALS_TEXT_FONT.'"><'.$TOTALS_TEXT_STYLE.'>'.number_format($grandtotal, 2).'</'.$TOTALS_TEXT_STYLE.'></font></td>';
$strHTML .= '</tr>';
$strHTML .= '</table>';
$strHTML .= '</div>';
}
echo $strHTML;
?>
</div>
<div id="wb_Text8" style="position:absolute;left:5px;top:450px;width:575px;height:16px;z-index:8;text-align:left;">
<span style="color:#FF0000;font-family:Arial;font-size:13px;">Delete the following text and checkbox if not applicable. Change State as required.</span></div>
<div id="wb_Text9" style="position:absolute;left:5px;top:468px;width:326px;height:15px;text-align:justify;z-index:9;">
<span style="color:#A52A00;font-family:Arial;font-size:12px;">Are you a California resident ?</span></div>
<div id="wb_Text4" style="position:absolute;left:371px;top:468px;width:210px;height:15px;text-align:justify;z-index:10;">
<span style="color:#A52A00;font-family:Arial;font-size:12px;">Yes, I'm a California resident</span></div>
<input type="checkbox" id="Checkbox1" name="resident" value="Yes" style="position:absolute;left:341px;top:467px;z-index:11;" <?php
if ($resident == "Yes"){
echo "checked";
}
?»
</form>
</div>
<div id="wb_Shape2" style="position:absolute;left:170px;top:133px;width:1px;height:403px;z-index:18;">
<img src="images/img0057.gif" id="Shape2" alt="" style="border-width:0;width:1px;height:403px;"></div>
<div id="NavigationBar1" style="position:absolute;left:25px;top:132px;width:131px;height:90px;z-index:19;">
<ul class="navbar">
<li><a href="./index.php"><img alt="" src="images/img0058_over.gif" class="hover"><span><img alt="" src="images/img0058.gif"></span></a></li>
<li><a href="./products.php"><img alt="" src="images/img0059_over.gif" class="hover"><span><img alt="" src="images/img0059.gif"></span></a></li>
<li><a href="./cart.php"><img alt="" src="images/img0060_over.gif" class="hover"><span><img alt="" src="images/img0060.gif"></span></a></li>
</ul>
</div>
<div id="wb_Text1" style="position:absolute;left:174px;top:89px;width:576px;height:12px;text-align:right;z-index:20;">
<?php
echo '<span style="color:#000000;font-family:Arial;font-size:9.3px;">Copyright © 2007 - '.date('Y').' Pablo Software Solutions Modified by <a href="http://www.dbtechnosystems.com" class="oil_text">DBTechnosystems.com</a> · All Rights reserved</span>';
?></div>
<div id="wb_Text5" style="position:absolute;left:20px;top:231px;width:145px;height:208px;z-index:21;text-align:left;">
<span style="background-color:#FFFF00;color:#A52A00;font-family:Arial;font-size:13px;"><strong> <u>Test Promo Codes: </u></strong></span><span style="color:#A52A00;font-family:Arial;font-size:13px;"><strong><u> </u><br><br>aa = €8, for orders of <br> €50 or more<br><br>bb = €10 for orders of<br> €80 or more<br><br>cc= €14 for orders of <br> €100 or more<br><br>dd= €16 for orders
of <br> €125 or more.</strong></span></div>
<div id="wb_Text6" style="position:absolute;left:20px;top:497px;width:145px;height:32px;text-align:center;z-index:22;">
<span style="color:#000000;font-family:Arial;font-size:13px;">Click <a href="javascript:popupwnd('admin/set_promo_demo.php','no','no','no','no','yes','no','100','1','810','700')" target="_self">here</a> to see the administration interface.</span></div>
<div id="wb_Text10" style="position:absolute;left:178px;top:492px;width:324px;height:30px;text-align:justify;z-index:23;">
<span style="color:#A52A00;font-family:Arial;font-size:12px;">If you have a discount code, please type it here and click "Recalculate"</span></div>
</div>
</body>
</html>