Location: PHPKode > projects > Simple PHP Shopping cart - asaancart > asaancart v-0.9/templates/site_my_cart.tpl
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{$title}</title>
<link href="../css/global.css" rel="stylesheet" type="text/css" />

<link href="../menu/css/dropdown/dropdown.css" media="all" rel="stylesheet" type="text/css" />
<link href="../menu/css/dropdown/themes/default/default.advanced.css" media="all" rel="stylesheet" type="text/css" />

<!--[if lt IE 7]>
<script type="text/javascript" src="../menu/js/jquery/jquery.js"></script>
<script type="text/javascript" src="../menu/js/jquery/jquery.dropdown.js"></script>
<![endif]-->


<!-- Initialize Dojo -->
        {literal}
        <script src='../dojo/dojo/dojo.js' type='text/javascript'></script>
        
        <script type='text/javascript'>
        //<!--

        // The following function submits the data from the 'post-form' form
        // to a PHP script located at
        // 'http://www.dojoforum.com/demo-0.9/xhr/parse_form.php'
        // The PHP script simply outputs a string in the format of
        // 'Hello $name!', which is then put in the <div> w/ the id
        // of 'response'.
        //
        // NOTE: As with xhrGet, you can also use handleAs to accept
        // JSON objects in your load() function.
		//dojo.require("dojo.style");
		function updateProductQty(id, product_id, cid) {
			
			product_qty = document.getElementById(id).value;
			
		            dojo.xhrPost ({
                        // The page that parses the POST request
                        url: 'update_cart.php?mode=update_qty&product_id='+product_id+'&id='+cid+'&product_qty='+product_qty,
               
                        // Name of the Form we want to submit
                        //form: 'login',
                
                        // Loads this function if everything went ok
                        load: function (data) {
                                // Put the data into the appropriate <div>
								//document.getElementById('loader2').style.display="";
                                dojo.byId('cart_box').innerHTML = data;
								//document.getElementById('loader2').style.display="none";
								
								
                        },
                        // Call this function if an error happened
                        error: function (error) {
                                console.error ('Error: ', error);
                        }
            });
			
        }
		
		function deleteCartProduct(product_id, cid) {
			
			
			
		            dojo.xhrPost ({
                        // The page that parses the POST request
                        url: 'update_cart.php?mode=delete&product_id='+product_id+'&id='+cid,
               
                        // Name of the Form we want to submit
                        //form: 'login',
                
                        // Loads this function if everything went ok
                        load: function (data) {
                                // Put the data into the appropriate <div>
								//document.getElementById('loader2').style.display="";
                                dojo.byId('cart_box').innerHTML = data;
								//document.getElementById('loader2').style.display="none";
								
								
                        },
                        // Call this function if an error happened
                        error: function (error) {
                                console.error ('Error: ', error);
                        }
            });
			
        }
		
		function changeProductImage(filename){
			document.getElementById("main_product_image").src = "../product_images/"+filename;
		}
		
		function openImageViewer(current_image, product_id, product_name){
		current_image = document.getElementById("main_product_image").src;
			window.open("image_viewer.php?current_image="+current_image+"&product_id="+product_id+'&product_name='+product_name, 'location=0, status=0, titlebar=0');
		}

			
        </script>
        {/literal}
</head>
<body>
<table width="{$layout_width}" border="0" cellspacing="0" cellpadding="0" align="{$layout_align}">
  <tr>
    <td>{include file='site_header.tpl'}
{include file='site_navigation.tpl'}</td>
  </tr>
  <tr>
    <td>
<h1>{$page_heading}</h1>
<div id="cart_box">
{include file='site_cart_detail.tpl}
</div>
</td>
  </tr>
  <tr>
    <td>{include file='site_footer.tpl}</td>
  </tr>
</table>

</body>
</html>
Return current item: Simple PHP Shopping cart - asaancart