Jump to content

Parse error: syntax error, unexpected ';' in C:\Home\www\cart.php on line 292


Recommended Posts

I cant find the problem anywhere ?!?

 

Can someone help please

 

 

<?php
//incluiding required pages
include_once("header.php");
if($_SESSION['requested_url']){
$loc = $_SESSION['requested_url'];
unset($_SESSION['requested_url']);
header("Location: $loc");
exit;
}
include_once($conf->absolute_path."classes/cart.php");
include_once($conf->absolute_path."classes/client_products.php");
include_once($conf->absolute_path."functions/general.php");
include_once($conf->absolute_path."classes/country.php");
include_once($conf->absolute_path."classes/client_coupons.php");
include_once($conf->absolute_path."classes/admin_shipping.php");
include_once($conf->absolute_path."classes/client_tax.php");
include_once($conf->absolute_path."classes/shopingcart_settings.php");
//echo '<p><pre>'; var_export($_SESSION);
//creating objects
$coupon=new client_coupons();//coupon object
$s_admin=new admin_shipping();
$obj_tax=new client_tax();
$cart=new cart();
$products=new client_products();
$country=new country();
//var_dump($currency_info);//exchange_rate


$sc_settings = new shopingcart_settings();

if($_SESSION['s_country_id'] != "" && $_SESSION['s_company_id'] != "")
{
//if client coming from continue shopping
if (isset($_POST['country_id']) && isset($_POST['company_ids']) )
{
  		//if on cart and changes teh company / country
	$_SESSION['s_country_id'] = $_POST['country_id']; 
  		$_SESSION['s_company_id'] = $_POST['company_ids']; 

}else
{
	//do nothing no change	
}	
}else{

$_SESSION['s_country_id'] = 223;
$_SESSION['s_company_id'] = $cart->getDefaultUKCompany(); 

}
//required functions
$country_data=$s_admin->getUniqueCountries();
#1 echo "<br>add 2 cart ";
$cart->Add2Cart();

#dont meean donot perform below three it is from wishlist
if(!$_GET['dont']){
$cart->updateCart();
#3 echo "<br> delete cart ";
//echo "deleting";
$cart->deleteItem();
#4 echo "<br> clear cart ";
$cart->clearCart();
}
//$cart->initialCheckOutRoutines();//run initial checkout rountines

$comp_data=$obj_tax->getCompanies();
//get cart items
$done=0;
if($data=& $cart->getCartWithDiscounts())
$done=1;
//echo '<p><pre>';var_export($data);
if (preg_match("/cart.php/i", $_SERVER['HTTP_REFERER']))
{
} else if(preg_match("/browse.php/i", $_SERVER['HTTP_REFERER'])) { 

$_SESSION['client_continue_shopping']=$_SERVER['HTTP_REFERER'];//for maintaining history of prev page

} else if(preg_match("/product_description.php/i", $_SERVER['HTTP_REFERER'])) { 

$_SESSION['client_continue_shopping']=$_SERVER['HTTP_REFERER'];//for maintaining history of prev page

} else if(empty($_SESSION['client_continue_shopping']))

{
$_SESSION['client_continue_shopping']="index.php";
}

//if cart is not empty then
if ($done)
{
//$_SESSION['country_id']=$_POST['country_id'];

$_SESSION['country_id']='223';

if($coupon->clearcoupon())

{
$clear_done=1;
}

if($_POST['coupon'] != "")
{

if($coupon->checkDiscountType())

{
$done2=1;
}
}
}

//echo $_SERVER['REQUEST_URI'];

//a variable just to check that user coming through the flow not from secpay backwards
$_SESSION['user_flow']='1';
?>
<script language="javascript" src="js/glib.js"></script>
<SCRIPT LANGUAGE="Javascript">


function loadlocation(selOpt)
{

id = new Array();	  
key = new Array();
value = new Array();


company_ids = document.update.company_ids;
country_id = document.update.country_id;
company_id = document.update.company_id;

var i = 1;
var kk = 1;
<?
$comp_data1=$obj_tax->jgetCompanies();
if ($comp_data1)
{
foreach ($comp_data1 as $arr)
{
?>

//to check and get real data use in conditions
key[i] = <?=$arr["country_id"]?>;
// these two values given below are store in combo fields 
id[i] = <?=$arr["company_id"]?>;
value[i] = "<?=$arr["company_name"]?>";

i+=1;
<? } } ?>

company_ids.options.length = 0;

company_ids.options[0] = new Option('Select Method',0);

for( i = 1; i < id.length; i++ )
{
//if( key[i] == country_id.value )

// if there are more then one countries open it 

if (country_id.value != "")
{
if( key[i] == country_id.value )
{ 



company_ids.options[kk] = new Option(value[i],id[i]);
//if(id[i] == (selOpt || "<?//=$_SESSION['s_company_id']?>")){
if(id[i] == "<?=$_SESSION['s_company_id']?>"){
company_ids.options[kk].selected = true;	
}else if(id[i] == (selOpt)){
company_ids.options[kk].selected = true;	
}
//company_id.value = id[i];

kk ++;
}
else{}
}
// if not more then one countries then give country id and open this code
/*
if( key[i] == '223' )
{ 

company_ids.options[kk] = new Option(value[i],id[i]);
//company_id.value = id[i];

kk ++;
}
else{}
*/
}

}

function updatedelivery()

{

document.update.submit();

}

function doSubmit(val)
{
//alert(document.update.company_ids.value);
if (document.update.company_ids.value != "" && document.update.company_ids.value != 0)
{
	document.update.company_id.value = document.update.company_ids.value;
}
document.update.submit();
}

function refreshThis(url)
{
//	alert(url);
window.location=url;

}
function refreshThisForm(url)

{

document.update.action=url;
document.update.submit();

}

</script>

<? // if($done) { ?>
<!--<link href="includes/topmenu.css" rel="stylesheet" type="text/css" />
<link href="includes/navigationbar.css" rel="stylesheet" type="text/css" />
<link href="includes/productlayout.css" rel="stylesheet" type="text/css" />
<link href="includes/companysettings.css" rel="stylesheet" type="text/css" />
<link href="includes/searchpanel.css" rel="stylesheet" type="text/css" />
<link href="includes/newslaterpanel.css" rel="stylesheet" type="text/css" />-->
<link href="includes/cartpage.css" rel="stylesheet" type="text/css">
<body onLoad="javascript:loadlocation();">

<table width="97%" border="0" align="right" cellpadding="0" cellspacing="0">
  <tr>
<td height="10" ></td>
  </tr>
  
  <tr>
<td height="30"><span class="txttitle_1">Shopping Cart</span></td>
  </tr>
  <tr>
<td> </td>
  </tr>
  
  <? if($done) { ?>
  <tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
	<td align="right" valign="top" ><table border="0" align="right" cellpadding="0" cellspacing="0" >
		<form method="post" name="coupon1" action="">
		  <tr>
			<td colspan="3" align="center" ><?  if($coupon->LastMsg!=null) echo $coupon->LastMsg."<br>"; ?> </td>
		  </tr>
		  <tr>
			<td align="right" >If you have discount coupon, enter here </td>
			<td width="5" align="right"><img src="images/trans.gif" width="5" height="1" /></td>
			<td align="right"><input name="coupon" type="text" class="txtBoxCart"  id="coupon" size="35" />
				<input name="couponbtn" type="submit" class="btnsCart"  id="couponbtn" value="  Apply  " /></td>
		  </tr>
		  <tr>
			<td colspan="3" align="right" > </td>
		  </tr>
		</form>
	</table></td>
  </tr>
  <tr>
	<td align="right" valign="top" ><table border="0" align="right" cellpadding="0" cellspacing="0" >
		<form method="post" name="coupon2" action="">
		  <tr>
			<td align="right"><input name="clear_coupon" type="submit" class="btnsCart" id="clear_coupon" value="Clear Coupon / Discount" /></td>
		  </tr>
		</form>
	  </table></td>
  </tr>
  
  <form name="update" method="post" action="<?=$_SERVER['SCRIPT_NAME']?>?update=yes">
  <tr>
	<td valign="top"><table width="100%" border="0" align="center" cellpadding="1" cellspacing="1">
		<tr>
		  <td height="10" align="center" class="error" valign="middle"><br>
			  <?=//print_r($_SESSION);?><br>
			  <? 
				if($message!="")
				{
					echo $message;
				}
				if($cart->LastMsg!=null)

					echo $cart->LastMsg;
				?>
		   </td>
		</tr>
	  </table></td>
  </tr>
  <tr>
	<td valign="top"><table width="100%" border="0" align="center" cellpadding="1" cellspacing="1">
		 <? if ($_SESSION['taxonof']) { 
			$tax_name = $sc_settings->getTaxName();
		?>
		<tr>
		  <td height="30" align="center" class="txtHeadingCart"><span class="txtheadingcart">Product Image</span> </td>
		  <td height="30" align="center" class="txtHeadingCart" >Product Name and<br />
Product Code </td>
		  <td align="center" class="txtHeadingCart" ><span class="txtheadingcart">Quantity</span>  </td>
		  <td width="70" align="center" class="txtHeadingCart" ><span class="txtheadingcart">Unit Price <br>Excluding <?=$tax_name?$tax_name:'Tax'?></span>  </td>
		  <td width="80" align="center" class="txtHeadingCart" ><span class="txtheadingcart">Total Price <br>Excluding <?=$tax_name?$tax_name:'Tax'?></span>  </td>
		  <td align="center" class="txtHeadingCart" > </td>
		</tr>
		<? } else {?>
		<tr>
		  <td height="30" align="center" class="txtHeadingCart"><span class="txtheadingcart">Product Image</span> </td>
		  <td height="30" align="center" class="txtHeadingCart" >Product Name and<br />
Product Code </td>
		  <td align="center" class="txtHeadingCart" ><span class="txtheadingcart">Quantity</span>  </td>
		  <td width="70" align="center" class="txtHeadingCart" ><span class="txtheadingcart">Unit Price</span>  </td>
		  <td width="80" align="center" class="txtHeadingCart" ><span class="txtheadingcart">Total Price</span>  </td>
		  <td align="center" class="txtHeadingCart" > </td>
		</tr>
		<? } ?>

		<?
		//echo '<p><pre>';var_export($data);
		foreach($data as $arr) { ?>
		<? //print_r($arr);?>
		<tr >
		  <td height="66" align="center" valign="middle" class="tblCartBg"><table width="91" height="60" border="0" align="center" cellpadding="0" cellspacing="0">
			  <tr>
				<td align="center" >
									<!-- ***********product image************ -->
				  <? if($arr['product_image'])
					{ //echo $arr['product_image']; ?>
				  <a href = 'product_description.php?product_id=<?=$arr['product_id']?>&category_id=<?=$arr['category_id']?>' > <img src="<?=$conf->image_dir."___".$arr['product_image']?>" alt="<?=$arr['product_name']?>" name="my1stMouseOver" border="0" id="my1stMouseOver"> </a>
				  <? } ?>
									<!-- end product image -->
				</td>
			  </tr>
		  </table></td>
		  <td valign="middle" class="tblCartBg"><a href = 'product_description.php?product_id=46&category_id=42' > </a>
			  <table width="100%" border="0" cellspacing="0" cellpadding="4">
				<tr>
				  <td align="center">
				  <a href = 'product_description.php?product_id=<?=$arr['product_id']?>&category_id=<?=$arr['category_id']?>' class='lnkProductNameCart'><?=htmlentities(stripslashes($arr['product_name']))?><br> (<?=$arr['product_code']?$arr['product_code']:$_GET['product_code']?>) </a><br />
					<span class="txtProductDesc">
					<? $done2=0;

					//if(($data2=$products->listProductAttributes($arr['product_id']))!=null)prod_attrib_detail
					if(($data2=$products->listProductAttributes($arr['pav_id']))!=null)
						{
							$done2=1;
						}
					if($done2)
					{
					//$gt=0;
					//echo'<p><pre>';var_export($data2);
					foreach($data2 as $att)

						{ ?>
							<small>
							<?=$att['attribute_name']?>
							:
							<?=$att['attribute_value']?>
							</small>

							<? if($att['sub_attribute_name']){?>
							   <br> <small>
								<?=$att['sub_attribute_name']?>
								:
								<?=$att['sub_attribute_value']?>
								</small>
						<? }?>

						 
					  <? }
						}
				?>   </span>
				  </td>
				</tr>
			</table></td>
		  <td align="center" valign="middle" class="tblCartBg">
		  <?
                if (!empty($_POST['coupon'])) {
                $_SESSION['kk'] = $_POST['coupon'];
                }
             ?>
                <input class="txtboxcart" name="quantity[]" value="<?=$arr['quantity']?$arr['quantity']:$_GET['quantity']?>" type="text" id="quantity[]" size="5" />
                <input name="product_name[]" value="<?=$arr['product_name']?$arr['product_name']:$_GET['product_name']?>"  type="hidden" id="product_name[]" />
                <input name="product_id[]" value="<?=$arr['product_id']?$arr['product_id']:$_GET['product_id']?>"  type="hidden" id="product_id[]" />
                <input name="product_attribute_id[]" value="<?=$arr['product_attribute_id']?>"  type="hidden" id="product_attribute_id[]" />
                <input name="main_attribute_id[]" type="hidden" value="<?=$arr['main_attribute_id']?$arr['main_attribute_id']:$arr['main_attribute_id']?>" id="main_attribute_id[]">
                <input name="sub_attribute_value_id[]" type="hidden" value="<?=$arr["sub_attribute_value_id"]?$arr["sub_attribute_value_id"]:$_GET["sub_attribute_value_idt"]?>" id="sub_attribute_value_id[]">
                
                <input name="product_attribute_value_id[]" type="hidden" value="<?=$arr["pav_id"]?$arr["pav_id"]:$_GET["product_attribute_value_id"]?>" id="product_attribute_value_id">
              <? if($arr['special_offer']!=0)
        
			echo "<br><small>+ ".$arr['special_offer']." free product(s)</small>";		

		  ?>
		  
		  </td>
		  <td align="center" valign="middle" class="tblCartBg" ><span class="txtPriceCart">
		  
		  <?  
			//will get either voucher or discount fpor all products so for single divide by 
			//quantuity or oput as whle so minus value from whole product 
			//if($_POST['coupon'] != "" && $coupon->LastMsg==NULL)
			//{
				$perproduct_dis_amount = $cart->nscdiscamount($arr['product_id'],$arr['quantity'],$arr['product_price']);
				if($currecny_info['exchange_rate']){
					$perproduct_dis_amount = $perproduct_dis_amount*$currecny_info['exchange_rate'];
				}
			//}
			//echo "THE DESIHN ".$perproduct_dis_amount;
			//echo ($currency_info['currency_symbol']?$currency_info['currency_symbol']:$conf->price_handler).number_format($arr['product_price'],2,'.','');
			?>  
			<?
			//echo "safd ". $currency_info['exchange_rate'];
			  if($perproduct_dis_amount!=0)
				{

					  $per_unit_dis=($perproduct_dis_amount/$arr['quantity']);
					  echo "<s>".($currency_info['currency_symbol']?$currency_info['currency_symbol']:$conf->price_handler).number_format($currency_info['exchange_rate']*$arr['product_price'],2,'.','')."</s>";
					  
					  echo "<br>".($currency_info['currency_symbol']?$currency_info['currency_symbol']:$conf->price_handler).number_format(($currency_info['exchange_rate']*($arr['product_price']-$per_unit_dis)),2,'.','');
					 // $gt += $arr['total']-$perproduct_dis_amount;
			   } else {
					   echo ($currency_info['currency_symbol']?$currency_info['currency_symbol']:$conf->price_handler).number_format(($currency_info['exchange_rate']*$arr['product_price']),2,'.','');
					   //$gt += $arr['total'];
			   }
			?>
		  
		  </span>  </td>
		  <td align="center" valign="middle" class="tblCartBg" ><span class="txtPriceCart" >
		  <?
		  if($perproduct_dis_amount!=0)
			{
				  
				  echo "<s>".($currency_info['currency_symbol']?$currency_info['currency_symbol']:$conf->price_handler).number_format(($currency_info['exchange_rate']*$arr['total']),2,'.','')."</s>";
				  echo "<br>".($currency_info['currency_symbol']?$currency_info['currency_symbol']:$conf->price_handler).number_format($currency_info['exchange_rate']*($arr['total']-$perproduct_dis_amount),2,'.','');
				  $gt += $arr['total']-$perproduct_dis_amount;
				  
		   } else {
				  
				   echo ($currency_info['currency_symbol']?$currency_info['currency_symbol']:$conf->price_handler).number_format(($currency_info['exchange_rate']*$arr['total']),2,'.','');
				   $gt += $arr['total'];
				  
		   }
		  ?>
		  </span> </td>
		  <td align="center" valign="middle" class="tblCartBg" ><a href="<?=$_SERVER['SCRIPT_NAME']?>?delete=yes&product_id=<?=$arr['product_id']?>&main_attribute_id=<?=$arr['main_attribute_id']?>&sub_attribute_id=<?=$arr['sub_attribute_value_id']?>" class='lnkProdSearch'><img src="images/cart/deletebtn.gif" name="button" alt="Remove Item" id="button" value="DEL" width="79" height="27" border="0"> </a></td>
		</tr>
		<? } ?>

	</table></td>
  </tr>
  <tr>
	<td height="5" valign="top"><img src="images/trans.gif" width="2" height="1" /></td>
  </tr>
  <tr>
	<td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr>
		  <td>
		  
		  <? if ($_SESSION['taxonof'] == 1) { ?>
		  <table width="100%" border="0" cellpadding="2" cellspacing="1">
			  
			  
			  <tr >
				<td height="20" align="right"  class="tblCartBg2"  ><span class="txtInvoiceCart">Order Total: </span></td>
				<td width="200" align="right" class="tblCartBg2"><span class="txtPriceCart" >
				<?=($currency_info['currency_symbol']?$currency_info['currency_symbol']:$conf->price_handler).number_format($currency_info['exchange_rate']*$gt,2,'.','')?>
                    <? $_SESSION['s_g_total']=$gt; ?></span> </td>
			  </tr>
			  
			  <tr >
			   <td height="20" align="right" class="tblCartBg2"  ><span class="txtInvoiceCart">Select Delivery Country:</span> </td>
			  <td align="right" class="tblCartBg2" >
				<select onChange="javascript:loadlocation();" name="country_id" id="country_id" class="txtBoxCart">
				<option value="">Select a country</option>
				<? 
					if($country_data!=null) {
					foreach($country_data as $c_data)
					{?>
							<option <? 
					if($c_data['country_id']==$_POST['country_id'])
					echo " selected";

					?> value="<?=$c_data['country_id']?>" >
							<?=$country->getCountryName($c_data['country_id'])?>
							</option>
							<? } }
				?>
				</select>
			   </td>
			</tr>
			  
			  <tr >
				<td height="20" align="right" class="tblCartBg2" > <span class="txtInvoiceCart">Select Delivery Methods:</span>  </td>
				<td align="right" class="tblCartBg2" >
				  <select onChange="doSubmit(this.value);" class="txtBoxCart" name="company_ids" id="company_ids">
				  <option value="">Select Method</option>
				  <?
					if($comp_data!=null)
					foreach($comp_data as $arr) { 
				  ?>
				  <? if ($_POST['company_ids'] == $arr['company_id']) {?>
				  <option value="<?=$arr['company_id']?>"  selected="selected">
				  <?=$arr['company_name']?>
				  </option>
				  <? }?>
				  <option value="<?=$arr['company_id']?>" >
				  <?=$arr['company_name']?>
				  </option>
				  <? } ?>
				</select>
				  <input name="company_id" type="hidden" id="company_id" value="<?=$_SESSION['s_company_id']?>" />
   					  <input name="Submit" type="submit" class="btnsCart" value="  Submit  "  />
				</td>
			  </tr>
			  <tr >
				<td height="20" align="right" class="tblCartBg2" ><!--Countries-->
					<span class="txtInvoiceCart">Delivery Charges(Excluding <?=$tax_name?$tax_name:'Tax'?>):</span> </td>
				<td align="right" class="tblCartBg2" ><span class="txtPriceCart">
				<? 		 
				  $cart->getShippingAmountWithoutTax();
				  $company_name=$s_admin->getCompanyName($_SESSION['s_company_id']); 
				  //echo "<span class=txtLableProdDesc>Company id = ".$_SESSION['s_company_id']."</span><br/>";
				  echo "<span class=txtLableProdDesc>".$company_name[0]['company_name']."</span>";
				?>
				<?=($currency_info['currency_symbol']?$currency_info['currency_symbol']:$conf->price_handler).number_format($currency_info['exchange_rate']*$cart->getShippingAmountWithoutTax(),2,'.','')?>
				<? $val2 = number_format($cart->getShippingAmountWithoutTax(),2,'.','')?>
				<? $_SESSION['s_ship_wotax'] = $val2 ?></span> </td>
			  </tr>
			  
			  <tr >
				  <td height="20" align="right" class="tblCartBg2" >
				  <span class="txtInvoiceCart">Total <?=$tax_name?$tax_name:'Tax'?>:</span></td>
				  <td align="right"   class="tblCartBg2" ><span class="txtPriceCart">
				  <?
				  #tofeeq starts coding here for individual product tax & shipping claculation

				  #tofeeq ends conding here for individual product tax & shipping calculation
				  ?>
				  <?=($currency_info['currency_symbol']?$currency_info['currency_symbol']:$conf->price_handler).number_format($currency_info['exchange_rate']*($cart->getProductsTaxSum()+$cart->getShippingTax()),2,'.','')?>
				  <? $val3 = number_format($cart->getProductsTaxSum()+$cart->getShippingTax(),2,'.','')?>
				  <!-- only for this site-->
				  <?// $pvat = $_SESSION['s_g_total']*0.175; ?>
				  <? //=$val3 = number_format($pvat+$cart->getShippingTax(),2,'.','')?>
				  <?
				  $_SESSION['Product_vat']=$cart->getProductsTaxSum(); 
				  //$_SESSION['Product_vat']=$pvat; 
				  $_SESSION['shipping_vat']=$cart->getShippingTax(); 
				  $_SESSION['total_vat'] = $val3;
				  ?>			                                          </span></td>
			</tr>
			  
			  
			  <tr>
				<td height="20" align="right" class="tblCartBg2" ><span class="txtInvoiceCart">Order Total(Including <?=$tax_name?$tax_name:'Tax'?>):</span></td>
				<td align="right" class="tblCartBg2" ><span class="txtPriceCart">
				<? 
					//$fv = $gt+$val2+$val3+$cart->getProductsTaxSum()+$cart->getShippingTax();
					$fv = $gt+$val2+$val3;
					echo ($currency_info['currency_symbol']?$currency_info['currency_symbol']:$conf->price_handler).number_format($currency_info['exchange_rate']*$fv,2,'.','');
					$_SESSION["final_values"] = $fv;
				?>
				</span></td>
			  </tr>
		  </table>
		  <? } else {?>
		  <table width="100%" border="0" cellpadding="2" cellspacing="1">
			  <tr  >
				<td height="20" align="right"   class="tblCartBg2"  ><span class="txtInvoiceCart">Order Total: </span></td>
				<td width="200" align="right" class="tblCartBg2"><span class="txtPriceCart" >
				<?=($currency_info['currency_symbol']?$currency_info['currency_symbol']:$conf->price_handler).number_format($currency_info['exchange_rate']*$gt,2,'.','')?> <? $_SESSION['s_g_total']=$gt; ?></span> </td>
			  </tr>
			  <tr  >
			   <td height="20" align="right"   class="tblCartBg2"  ><span class="txtInvoiceCart">Select Delivery Country:</span> </td>
			  <td align="right" class="tblCartBg2" >
				<select onChange="javascript:loadlocation();" name="country_id" id="country_id" class="txtBoxCart">
				<option value="">Select a country</option>
				<? 
					if($country_data!=null) {
					foreach($country_data as $c_data) {
				?>
					<option <? 
					if($c_data['country_id']==$_POST['country_id'])
					echo " selected";

					?> value="<?=$c_data['country_id']?>" >
					<?=$country->getCountryName($c_data['country_id'])?>
					</option>
					<? } }
				?>
				</select>
			   </td>
			</tr>
			  <tr  >
				<td height="20" align="right"   class="tblCartBg2" > <span class="txtInvoiceCart">Select Delivery Methods:</span>  </td>
				<td align="right" class="tblCartBg2" >
				<select onChange="doSubmit();" class="txtBoxCart" name="company_ids" id="company_ids">
				  <option value="">Select Method</option>
				  <?
					if($comp_data!=null)
					foreach($comp_data as $arr) {
				  ?>
				  <? if ($_POST['company_ids'] == $arr['company_id']) {?>
				  <option value="<?=$arr['company_id']?>"  selected="selected">
				  <?=$arr['company_name']?>
				  </option>
				  <? }?>
				  <option value="<?=$arr['company_id']?>" >
				  <?=$arr['company_name']?>
				  </option>
				  <? } ?>
				</select>
              <input name="company_id" type="hidden" id="company_id" value="<?=$_SESSION['s_company_id']?>" /><input type="submit" name="Submit" value="Submit" class="btnsCart"></td>
			  </tr>
			  <tr  >
				<td height="20" align="right"   class="tblCartBg2" ><!--Countries-->
					<span class="txtInvoiceCart">Delivery Charges:</span> </td>
				<td align="right"   class="tblCartBg2" ><span class="txtPriceCart">
				<? 		 
				  $cart->getShippingAmountWithoutTax();
				  $company_name=$s_admin->getCompanyName($_SESSION['s_company_id']); 
				  //echo "<span class=txtLableProdDesc>Company id = ".$_SESSION['s_company_id']."</span><br/>";
				  echo "<span class=txtLableProdDesc>".$company_name[0]['company_name']."</span>";
				?>
				<?=($currency_info['currency_symbol']?$currency_info['currency_symbol']:$conf->price_handler).number_format($currency_info['exchange_rate']*$cart->getShippingAmountWithoutTax(),2,'.','')?>
				<? $val2 = number_format($cart->getShippingAmountWithoutTax(),2,'.','')?>
				<? $_SESSION['s_ship_wotax'] = $val2 ?></span> </td>
			  </tr>
			  <tr>
				<td height="20" align="right" class="tblCartBg2" ><span class="txtInvoiceCart">Order Total:</span></td>
				<td align="right" class="tblCartBg2" ><span class="txtPriceCart">
				<? 
					$fv = $gt+$val2+$val3;
					echo ($currency_info['currency_symbol']?$currency_info['currency_symbol']:$conf->price_handler).number_format($currency_info['exchange_rate']*$fv,2,'.','');
					$_SESSION["final_values"] = $fv;
				?></span></td>
			  </tr>
		  </table>
		  <? } ?>
		  
		  </td>
		</tr>
	</table></td>
  </tr>
  <tr>
	<td height="8" valign="top"></td>
  </tr>
  <tr>
	<td valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
		<tr>
		  <td height="40" colspan="2" align="right"><img src="images/cart/contshopbtn.gif" alt="Continue Shopping" width="113" height="28" border="0" style="cursor:pointer;" onClick="refreshThis('<?=$_SESSION['client_continue_shopping']?>')" /> <img src="images/cart/upcartbtn.gif" alt="Update Cart" width="113" height="28" border="0" style="cursor:pointer;" onClick="doSubmit()" /> <img src="images/cart/clearcartbtn.gif" alt="Clear Cart" width="113" height="28" border="0" style="cursor:pointer;" onClick="refreshThis('cart.php?clearCart=yes')" /> <a href="login.php"><img src="images/cart/chkoutbtn.gif" alt="Checkout" width="113" height="28" border="0" style="cursor:pointer;"/></a></td>
		</tr>
	</table></td>
  </tr>
  </form>
</table></td>
  </tr>
  <? } else { ?>
  <tr>
  	<td align="center" class="error">No Item in Cart.<br />
        <br>
        <? 
	if($message!="")
	{
	//echo $message;
	}
	if($cart->LastMsg!=null)

	//echo $cart->LastMsg;
	?></td>
  </tr>
  <? } ?>
</table>

<?php /*?><? } else { ?>
<table width="97%" border="0" align="right" cellpadding="0" cellspacing="0">
  <tr>
<td height="10" ></td>
  </tr>
  
  <tr>
<td height="30"><span class="txttitle_1">Shipping Cart</span></td>
  </tr>
  <tr>
<td> </td>
  </tr>
  <tr>
  	<td align="center" class="error">No Item in Cart.<br />
        <br>
        <? 
	if($message!="")
	{
	//echo $message;
	}
	if($cart->LastMsg!=null)

	//echo $cart->LastMsg;
	?></td>
  </tr>
</table>

<? } ?><?php */?>

    <?
    
    $cart->destroy_cart();
    
    $products->destroy_client_products();
    //echo '<p><pre>'; var_export($_SESSION);
    include_once("footer.php");
$totalpros = 0; 
if($_SESSION['cart_code']){
	$total_items = 0;
	$total_price = 0;
	foreach(unserialize($_SESSION['quantity']) as $pros){
		$totalpros += $pros ;
	}
}
    ?>
    <script language="javascript">
if("<?=count(unserialize($_SESSION['cart_code']))?>" > 0){
	//document.getElementById("total_items").innerHTML = "<?//=$totalpros?>";
	//document.getElementById("total_price").innerHTML = "<?//=($currency_info['currency_symbol']?$currency_info['currency_symbol']:$conf->price_handler).number_format($fv,2,'.','');?>";
}

    selectComboOption(document.update.country_id,"<?=$_SESSION['s_country_id']?>");
    
    </script>

 

(edited to add


tags)

 

Apologies.. I did a surround <php> in a post preview but now i know i need code tags i will use this!

 

Here are the lines

 

<td height="10" align="center" class="error" valign="middle"><br>
			  <?=//print_r($_SESSION);?><br>
			  <? 
				if($message!="")
				{
					echo $message;
				}
				if($cart->LastMsg!=null)

					echo $cart->LastMsg;
				?>
		   </td>
		</tr>

 

Thanks

I'm not an expert or 100% sure, but search & replace to convert short tags to long tags?

 

And from what I can see at:

http://au2.php.net/manual/en/language.basic-syntax.php

 

<= ... ?> is short tag for <?php echo ... ?> and your line is

 

<=//print_r($_SESSION);?>

 

So the code is trying to echo '//print_r($_SESSION);'

 

I don't use echo much or short tags so I don't know what the problem is exactly, but I'd say try changing it to:

 

<?php

print_r($_SESSION);

?>

 

as print_r() will output the contents of $_SESSION and you don't need it to be 'echo'ed as well.

<?php

//incluiding required pages

include_once("header.php");

if($_SESSION['requested_url']){

$loc = $_SESSION['requested_url'];

unset($_SESSION['requested_url']);

header("Location: $loc");

exit;

}

include_once($conf->absolute_path."classes/cart.php");

include_once($conf->absolute_path."classes/client_products.php");

include_once($conf->absolute_path."functions/general.php");

include_once($conf->absolute_path."classes/country.php");

include_once($conf->absolute_path."classes/client_coupons.php");

include_once($conf->absolute_path."classes/admin_shipping.php");

include_once($conf->absolute_path."classes/client_tax.php");

include_once($conf->absolute_path."classes/shopingcart_settings.php");

//echo '<p><pre>'; var_export($_SESSION);

//creating objects

$coupon=new client_coupons();//coupon object

$s_admin=new admin_shipping();

$obj_tax=new client_tax();

$cart=new cart();

$products=new client_products();

$country=new country();

//var_dump($currency_info);//exchange_rate

 

 

$sc_settings = new shopingcart_settings();

 

if($_SESSION['s_country_id'] != "" && $_SESSION['s_company_id'] != "")

{

//if client coming from continue shopping

if (isset($_POST['country_id']) && isset($_POST['company_ids']) )

{

  //if on cart and changes teh company / country

$_SESSION['s_country_id'] = $_POST['country_id'];

  $_SESSION['s_company_id'] = $_POST['company_ids'];

 

}else

{

//do nothing no change

}

}else{

 

$_SESSION['s_country_id'] = 223;

$_SESSION['s_company_id'] = $cart->getDefaultUKCompany();

 

}

//required functions

$country_data=$s_admin->getUniqueCountries();

#1 echo "<br>add 2 cart ";

$cart->Add2Cart();

 

#dont meean donot perform below three it is from wishlist

if(!$_GET['dont']){

$cart->updateCart();

#3 echo "<br> delete cart ";

//echo "deleting";

$cart->deleteItem();

#4 echo "<br> clear cart ";

$cart->clearCart();

}

//$cart->initialCheckOutRoutines();//run initial checkout rountines

 

$comp_data=$obj_tax->getCompanies();

//get cart items

$done=0;

if($data=& $cart->getCartWithDiscounts())

$done=1;

//echo '<p><pre>';var_export($data);

if (preg_match("/cart.php/i", $_SERVER['HTTP_REFERER']))

{

} else if(preg_match("/browse.php/i", $_SERVER['HTTP_REFERER'])) {

 

$_SESSION['client_continue_shopping']=$_SERVER['HTTP_REFERER'];//for maintaining history of prev page

 

} else if(preg_match("/product_description.php/i", $_SERVER['HTTP_REFERER'])) {

 

$_SESSION['client_continue_shopping']=$_SERVER['HTTP_REFERER'];//for maintaining history of prev page

 

} else if(empty($_SESSION['client_continue_shopping']))

 

{

$_SESSION['client_continue_shopping']="index.php";

}

 

//if cart is not empty then

if ($done)

{

//$_SESSION['country_id']=$_POST['country_id'];

 

$_SESSION['country_id']='223';

 

if($coupon->clearcoupon())

 

{

$clear_done=1;

}

 

if($_POST['coupon'] != "")

{

 

if($coupon->checkDiscountType())

 

{

$done2=1;

}

}

}

 

//echo $_SERVER['REQUEST_URI'];

 

//a variable just to check that user coming through the flow not from secpay backwards

$_SESSION['user_flow']='1';

?>

<script language="javascript" src="../New Folder/js/glib.js"></script>

<SCRIPT LANGUAGE="Javascript">

 

 

function loadlocation(selOpt)

{

 

id = new Array();  

key = new Array();

value = new Array();

 

 

company_ids = document.update.company_ids;

country_id = document.update.country_id;

company_id = document.update.company_id;

 

var i = 1;

var kk = 1;

<?

$comp_data1=$obj_tax->jgetCompanies();

if ($comp_data1)

{

foreach ($comp_data1 as $arr)

{

?>

 

//to check and get real data use in conditions

key = <?=$arr["country_id"]?>;

// these two values given below are store in combo fields

id = <?=$arr["company_id"]?>;

value = "<?=$arr["company_name"]?>";

 

i+=1;

<? } } ?>

 

company_ids.options.length = 0;

 

company_ids.options[0] = new Option('Select Method',0);

 

for( i = 1; i < id.length; i++ )

{

//if( key == country_id.value )

 

// if there are more then one countries open it

 

if (country_id.value != "")

{

if( key == country_id.value )

{

 

 

 

company_ids.options[kk] = new Option(value,id);

//if(id == (selOpt || "<?//=$_SESSION['s_company_id']?>")){

if(id == "<?=$_SESSION['s_company_id']?>"){

company_ids.options[kk].selected = true;

}else if(id == (selOpt)){

company_ids.options[kk].selected = true;

}

//company_id.value = id;

 

kk ++;

}

else{}

}

// if not more then one countries then give country id and open this code

/*

if( key == '223' )

{

 

company_ids.options[kk] = new Option(value,id);

//company_id.value = id;

 

kk ++;

}

else{}

*/

}

 

}

 

function updatedelivery()

 

{

 

document.update.submit();

 

}

 

function doSubmit(val)

{

//alert(document.update.company_ids.value);

if (document.update.company_ids.value != "" && document.update.company_ids.value != 0)

{

document.update.company_id.value = document.update.company_ids.value;

}

document.update.submit();

}

 

function refreshThis(url)

{

// alert(url);

window.location=url;

 

}

function refreshThisForm(url)

 

{

 

document.update.action=url;

document.update.submit();

 

}

 

</script>

 

<? // if($done) { ?>

<!--<link href="includes/topmenu.css" rel="stylesheet" type="text/css" />

<link href="includes/navigationbar.css" rel="stylesheet" type="text/css" />

<link href="includes/productlayout.css" rel="stylesheet" type="text/css" />

<link href="includes/companysettings.css" rel="stylesheet" type="text/css" />

<link href="includes/searchpanel.css" rel="stylesheet" type="text/css" />

<link href="includes/newslaterpanel.css" rel="stylesheet" type="text/css" />-->

<link href="../New Folder/includes/cartpage.css" rel="stylesheet" type="text/css">

<body onLoad="javascript:loadlocation();">

 

<table width="97%" border="0" align="right" cellpadding="0" cellspacing="0">

  <tr>

<td height="10" ></td>

  </tr>

 

  <tr>

<td height="30"><span class="txttitle_1">Shopping Cart</span></td>

  </tr>

  <tr>

<td> </td>

  </tr>

 

  <? if($done) { ?>

  <tr>

<td><table width="100%" border="0" cellpadding="0" cellspacing="0">

  <tr>

<td align="right" valign="top" ><table border="0" align="right" cellpadding="0" cellspacing="0" >

<form method="post" name="coupon1" action="">

  <tr>

<td colspan="3" align="center" ><?  if($coupon->LastMsg!=null) echo $coupon->LastMsg."<br>"; ?> </td>

  </tr>

  <tr>

<td align="right" >If you have discount coupon, enter here </td>

<td width="5" align="right"><img src="../New Folder/images/trans.gif" width="5" height="1" /></td>

<td align="right"><input name="coupon" type="text" class="txtBoxCart"  id="coupon" size="35" />

<input name="couponbtn" type="submit" class="btnsCart"  id="couponbtn" value="  Apply  " /></td>

  </tr>

  <tr>

<td colspan="3" align="right" > </td>

  </tr>

</form>

</table></td>

  </tr>

  <tr>

<td align="right" valign="top" ><table border="0" align="right" cellpadding="0" cellspacing="0" >

<form method="post" name="coupon2" action="">

  <tr>

<td align="right"><input name="clear_coupon" type="submit" class="btnsCart" id="clear_coupon" value="Clear Coupon / Discount" /></td>

  </tr>

</form>

  </table></td>

  </tr>

 

  <form name="update" method="post" action="<?=$_SERVER['../New Folder/SCRIPT_NAME']?>?update=yes">

  <tr>

<td valign="top"><table width="100%" border="0" align="center" cellpadding="1" cellspacing="1">

<tr>

  <td height="10" align="center" class="error" valign="middle"><br>

 

  <?

if($message!="")

{

echo $message;

}

if($cart->LastMsg!=null)

 

echo $cart->LastMsg;

?>

  </td>

</tr>

  </table></td>

  </tr>

  <tr>

<td valign="top"><table width="100%" border="0" align="center" cellpadding="1" cellspacing="1">

<? if ($_SESSION['taxonof']) {

$tax_name = $sc_settings->getTaxName();

?>

<tr>

  <td height="30" align="center" class="txtHeadingCart"><span class="txtheadingcart">Product Image</span> </td>

  <td height="30" align="center" class="txtHeadingCart" >Product Name and<br />

Product Code </td>

  <td align="center" class="txtHeadingCart" ><span class="txtheadingcart">Quantity</span>  </td>

  <td width="70" align="center" class="txtHeadingCart" ><span class="txtheadingcart">Unit Price <br>Excluding <?=$tax_name?$tax_name:'Tax'?></span>  </td>

  <td width="80" align="center" class="txtHeadingCart" ><span class="txtheadingcart">Total Price <br>Excluding <?=$tax_name?$tax_name:'Tax'?></span>  </td>

  <td align="center" class="txtHeadingCart" > </td>

</tr>

<? } else {?>

<tr>

  <td height="30" align="center" class="txtHeadingCart"><span class="txtheadingcart">Product Image</span> </td>

  <td height="30" align="center" class="txtHeadingCart" >Product Name and<br />

Product Code </td>

  <td align="center" class="txtHeadingCart" ><span class="txtheadingcart">Quantity</span>  </td>

  <td width="70" align="center" class="txtHeadingCart" ><span class="txtheadingcart">Unit Price</span>  </td>

  <td width="80" align="center" class="txtHeadingCart" ><span class="txtheadingcart">Total Price</span>  </td>

  <td align="center" class="txtHeadingCart" > </td>

</tr>

<? } ?>

 

<?

//echo '<p><pre>';var_export($data);

foreach($data as $arr) { ?>

<? //print_r($arr);?>

<tr >

  <td height="66" align="center" valign="middle" class="tblCartBg"><table width="91" height="60" border="0" align="center" cellpadding="0" cellspacing="0">

  <tr>

<td align="center" >

<!-- ***********product image************ -->

  <? if($arr['product_image'])

{ //echo $arr['product_image']; ?>

  <a href = '../New Folder/product_description.php?product_id=<?=$arr['product_id']?>&category_id=<?=$arr['category_id']?>' > <img src="<?=$conf->image_dir."../New Folder/___".$arr['product_image']?>" alt="<?=$arr['product_name']?>" name="my1stMouseOver" border="0" id="my1stMouseOver"> </a>

  <? } ?>

<!-- end product image -->

</td>

  </tr>

  </table></td>

  <td valign="middle" class="tblCartBg"><a href = '../New Folder/product_description.php?product_id=46&category_id=42' > </a>

  <table width="100%" border="0" cellspacing="0" cellpadding="4">

<tr>

  <td align="center">

  <a href = '../New Folder/product_description.php?product_id=<?=$arr['product_id']?>&category_id=<?=$arr['category_id']?>' class='lnkProductNameCart'><?=htmlentities(stripslashes($arr['product_name']))?><br> (<?=$arr['product_code']?$arr['product_code']:$_GET['product_code']?>) </a><br />

<span class="txtProductDesc">

<? $done2=0;

 

//if(($data2=$products->listProductAttributes($arr['product_id']))!=null)prod_attrib_detail

if(($data2=$products->listProductAttributes($arr['pav_id']))!=null)

{

$done2=1;

}

if($done2)

{

//$gt=0;

//echo'<p><pre>';var_export($data2);

foreach($data2 as $att)

 

{ ?>

<small>

<?=$att['attribute_name']?>

:

<?=$att['attribute_value']?>

</small>

 

<? if($att['sub_attribute_name']){?>

  <br> <small>

<?=$att['sub_attribute_name']?>

:

<?=$att['sub_attribute_value']?>

</small>

<? }?>

 

 

  <? }

}

?>  </span>

  </td>

</tr>

</table></td>

  <td align="center" valign="middle" class="tblCartBg">

  <?

                if (!empty($_POST['coupon'])) {

                $_SESSION['kk'] = $_POST['coupon'];

                }

            ?>

                <input class="txtboxcart" name="quantity[]" value="<?=$arr['quantity']?$arr['quantity']:$_GET['quantity']?>" type="text" id="quantity[]" size="5" />

                <input name="product_name[]" value="<?=$arr['product_name']?$arr['product_name']:$_GET['product_name']?>"  type="hidden" id="product_name[]" />

                <input name="product_id[]" value="<?=$arr['product_id']?$arr['product_id']:$_GET['product_id']?>"  type="hidden" id="product_id[]" />

                <input name="product_attribute_id[]" value="<?=$arr['product_attribute_id']?>"  type="hidden" id="product_attribute_id[]" />

                <input name="main_attribute_id[]" type="hidden" value="<?=$arr['main_attribute_id']?$arr['main_attribute_id']:$arr['main_attribute_id']?>" id="main_attribute_id[]">

                <input name="sub_attribute_value_id[]" type="hidden" value="<?=$arr["sub_attribute_value_id"]?$arr["sub_attribute_value_id"]:$_GET["sub_attribute_value_idt"]?>" id="sub_attribute_value_id[]">

               

                <input name="product_attribute_value_id[]" type="hidden" value="<?=$arr["pav_id"]?$arr["pav_id"]:$_GET["product_attribute_value_id"]?>" id="product_attribute_value_id">

              <? if($arr['special_offer']!=0)

       

echo "<br><small>+ ".$arr['special_offer']." free product(s)</small>";

 

  ?>

 

  </td>

  <td align="center" valign="middle" class="tblCartBg" ><span class="txtPriceCart">

 

  <? 

//will get either voucher or discount fpor all products so for single divide by

//quantuity or oput as whle so minus value from whole product

//if($_POST['coupon'] != "" && $coupon->LastMsg==NULL)

//{

$perproduct_dis_amount = $cart->nscdiscamount($arr['product_id'],$arr['quantity'],$arr['product_price']);

if($currecny_info['exchange_rate']){

$perproduct_dis_amount = $perproduct_dis_amount*$currecny_info['exchange_rate'];

}

//}

//echo "THE DESIHN ".$perproduct_dis_amount;

//echo ($currency_info['currency_symbol']?$currency_info['currency_symbol']:$conf->price_handler).number_format($arr['product_price'],2,'.','');

?> 

<?

//echo "safd ". $currency_info['exchange_rate'];

  if($perproduct_dis_amount!=0)

{

 

  $per_unit_dis=($perproduct_dis_amount/$arr['quantity']);

  echo "<s>".($currency_info['currency_symbol']?$currency_info['currency_symbol']:$conf->price_handler).number_format($currency_info['exchange_rate']*$arr['product_price'],2,'.','')."</s>";

 

  echo "<br>".($currency_info['currency_symbol']?$currency_info['currency_symbol']:$conf->price_handler).number_format(($currency_info['exchange_rate']*($arr['product_price']-$per_unit_dis)),2,'.','');

// $gt += $arr['total']-$perproduct_dis_amount;

  } else {

  echo ($currency_info['currency_symbol']?$currency_info['currency_symbol']:$conf->price_handler).number_format(($currency_info['exchange_rate']*$arr['product_price']),2,'.','');

  //$gt += $arr['total'];

  }

?>

 

  </span>  </td>

  <td align="center" valign="middle" class="tblCartBg" ><span class="txtPriceCart" >

  <?

  if($perproduct_dis_amount!=0)

{

 

  echo "<s>".($currency_info['currency_symbol']?$currency_info['currency_symbol']:$conf->price_handler).number_format(($currency_info['exchange_rate']*$arr['total']),2,'.','')."</s>";

  echo "<br>".($currency_info['currency_symbol']?$currency_info['currency_symbol']:$conf->price_handler).number_format($currency_info['exchange_rate']*($arr['total']-$perproduct_dis_amount),2,'.','');

  $gt += $arr['total']-$perproduct_dis_amount;

 

  } else {

 

  echo ($currency_info['currency_symbol']?$currency_info['currency_symbol']:$conf->price_handler).number_format(($currency_info['exchange_rate']*$arr['total']),2,'.','');

  $gt += $arr['total'];

 

  }

  ?>

  </span> </td>

  <td align="center" valign="middle" class="tblCartBg" ><a href="../New Folder/<?=$_SERVER['SCRIPT_NAME']?>?delete=yes&product_id=<?=$arr['product_id']?>&main_attribute_id=<?=$arr['main_attribute_id']?>&sub_attribute_id=<?=$arr['sub_attribute_value_id']?>" class='lnkProdSearch'><img src="../New Folder/images/cart/deletebtn.gif" name="button" alt="Remove Item" id="button" value="DEL" width="79" height="27" border="0"> </a></td>

</tr>

<? } ?>

 

</table></td>

  </tr>

  <tr>

<td height="5" valign="top"><img src="../New Folder/images/trans.gif" width="2" height="1" /></td>

  </tr>

  <tr>

<td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">

<tr>

  <td>

 

  <? if ($_SESSION['taxonof'] == 1) { ?>

  <table width="100%" border="0" cellpadding="2" cellspacing="1">

 

 

  <tr >

<td height="20" align="right"  class="tblCartBg2"  ><span class="txtInvoiceCart">Order Total: </span></td>

<td width="200" align="right" class="tblCartBg2"><span class="txtPriceCart" >

<?=($currency_info['currency_symbol']?$currency_info['currency_symbol']:$conf->price_handler).number_format($currency_info['exchange_rate']*$gt,2,'.','')?>

                    <? $_SESSION['s_g_total']=$gt; ?></span> </td>

  </tr>

 

  <tr >

  <td height="20" align="right" class="tblCartBg2"  ><span class="txtInvoiceCart">Select Delivery Country:</span> </td>

  <td align="right" class="tblCartBg2" >

<select onChange="javascript:loadlocation();" name="country_id" id="country_id" class="txtBoxCart">

<option value="">Select a country</option>

<?

if($country_data!=null) {

foreach($country_data as $c_data)

{?>

<option <?

if($c_data['country_id']==$_POST['country_id'])

echo " selected";

 

?> value="<?=$c_data['country_id']?>" >

<?=$country->getCountryName($c_data['country_id'])?>

</option>

<? } }

?>

</select>

  </td>

</tr>

 

  <tr >

<td height="20" align="right" class="tblCartBg2" > <span class="txtInvoiceCart">Select Delivery Methods:</span>  </td>

<td align="right" class="tblCartBg2" >

  <select onChange="doSubmit(this.value);" class="txtBoxCart" name="company_ids" id="company_ids">

  <option value="">Select Method</option>

  <?

if($comp_data!=null)

foreach($comp_data as $arr) {

  ?>

  <? if ($_POST['company_ids'] == $arr['company_id']) {?>

  <option value="<?=$arr['company_id']?>"  selected="selected">

  <?=$arr['company_name']?>

  </option>

  <? }?>

  <option value="<?=$arr['company_id']?>" >

  <?=$arr['company_name']?>

  </option>

  <? } ?>

</select>

  <input name="company_id" type="hidden" id="company_id" value="<?=$_SESSION['s_company_id']?>" />

    <input name="Submit" type="submit" class="btnsCart" value="  Submit  "  />

</td>

  </tr>

  <tr >

<td height="20" align="right" class="tblCartBg2" ><!--Countries-->

<span class="txtInvoiceCart">Delivery Charges(Excluding <?=$tax_name?$tax_name:'Tax'?>):</span> </td>

<td align="right" class="tblCartBg2" ><span class="txtPriceCart">

<?

  $cart->getShippingAmountWithoutTax();

  $company_name=$s_admin->getCompanyName($_SESSION['s_company_id']);

  //echo "<span class=txtLableProdDesc>Company id = ".$_SESSION['s_company_id']."</span><br/>";

  echo "<span class=txtLableProdDesc>".$company_name[0]['company_name']."</span>";

?>

<?=($currency_info['currency_symbol']?$currency_info['currency_symbol']:$conf->price_handler).number_format($currency_info['exchange_rate']*$cart->getShippingAmountWithoutTax(),2,'.','')?>

<? $val2 = number_format($cart->getShippingAmountWithoutTax(),2,'.','')?>

<? $_SESSION['s_ship_wotax'] = $val2 ?></span> </td>

  </tr>

 

  <tr >

  <td height="20" align="right" class="tblCartBg2" >

  <span class="txtInvoiceCart">Total <?=$tax_name?$tax_name:'Tax'?>:</span></td>

  <td align="right"  class="tblCartBg2" ><span class="txtPriceCart">

  <?

  #tofeeq starts coding here for individual product tax & shipping claculation

 

  #tofeeq ends conding here for individual product tax & shipping calculation

  ?>

  <?=($currency_info['currency_symbol']?$currency_info['currency_symbol']:$conf->price_handler).number_format($currency_info['exchange_rate']*($cart->getProductsTaxSum()+$cart->getShippingTax()),2,'.','')?>

  <? $val3 = number_format($cart->getProductsTaxSum()+$cart->getShippingTax(),2,'.','')?>

  <!-- only for this site-->

  <?// $pvat = $_SESSION['s_g_total']*0.175; ?>

  <? //=$val3 = number_format($pvat+$cart->getShippingTax(),2,'.','')?>

  <?

  $_SESSION['Product_vat']=$cart->getProductsTaxSum();

  //$_SESSION['Product_vat']=$pvat;

  $_SESSION['shipping_vat']=$cart->getShippingTax();

  $_SESSION['total_vat'] = $val3;

  ?>                                           </span></td>

</tr>

 

 

  <tr>

<td height="20" align="right" class="tblCartBg2" ><span class="txtInvoiceCart">Order Total(Including <?=$tax_name?$tax_name:'Tax'?>):</span></td>

<td align="right" class="tblCartBg2" ><span class="txtPriceCart">

<?

//$fv = $gt+$val2+$val3+$cart->getProductsTaxSum()+$cart->getShippingTax();

$fv = $gt+$val2+$val3;

echo ($currency_info['currency_symbol']?$currency_info['currency_symbol']:$conf->price_handler).number_format($currency_info['exchange_rate']*$fv,2,'.','');

$_SESSION["final_values"] = $fv;

?>

</span></td>

  </tr>

  </table>

  <? } else {?>

  <table width="100%" border="0" cellpadding="2" cellspacing="1">

  <tr  >

<td height="20" align="right"  class="tblCartBg2"  ><span class="txtInvoiceCart">Order Total: </span></td>

<td width="200" align="right" class="tblCartBg2"><span class="txtPriceCart" >

<?=($currency_info['currency_symbol']?$currency_info['currency_symbol']:$conf->price_handler).number_format($currency_info['exchange_rate']*$gt,2,'.','')?> <? $_SESSION['s_g_total']=$gt; ?></span> </td>

  </tr>

  <tr  >

  <td height="20" align="right"  class="tblCartBg2"  ><span class="txtInvoiceCart">Select Delivery Country:</span> </td>

  <td align="right" class="tblCartBg2" >

<select onChange="javascript:loadlocation();" name="country_id" id="country_id" class="txtBoxCart">

<option value="">Select a country</option>

<?

if($country_data!=null) {

foreach($country_data as $c_data) {

?>

<option <?

if($c_data['country_id']==$_POST['country_id'])

echo " selected";

 

?> value="<?=$c_data['country_id']?>" >

<?=$country->getCountryName($c_data['country_id'])?>

</option>

<? } }

?>

</select>

  </td>

</tr>

  <tr  >

<td height="20" align="right"  class="tblCartBg2" > <span class="txtInvoiceCart">Select Delivery Methods:</span>  </td>

<td align="right" class="tblCartBg2" >

<select onChange="doSubmit();" class="txtBoxCart" name="company_ids" id="company_ids">

  <option value="">Select Method</option>

  <?

if($comp_data!=null)

foreach($comp_data as $arr) {

  ?>

  <? if ($_POST['company_ids'] == $arr['company_id']) {?>

  <option value="<?=$arr['company_id']?>"  selected="selected">

  <?=$arr['company_name']?>

  </option>

  <? }?>

  <option value="<?=$arr['company_id']?>" >

  <?=$arr['company_name']?>

  </option>

  <? } ?>

</select>

              <input name="company_id" type="hidden" id="company_id" value="<?=$_SESSION['s_company_id']?>" /><input type="submit" name="Submit" value="Submit" class="btnsCart"></td>

  </tr>

  <tr  >

<td height="20" align="right"  class="tblCartBg2" ><!--Countries-->

<span class="txtInvoiceCart">Delivery Charges:</span> </td>

<td align="right"  class="tblCartBg2" ><span class="txtPriceCart">

<?

  $cart->getShippingAmountWithoutTax();

  $company_name=$s_admin->getCompanyName($_SESSION['s_company_id']);

  //echo "<span class=txtLableProdDesc>Company id = ".$_SESSION['s_company_id']."</span><br/>";

  echo "<span class=txtLableProdDesc>".$company_name[0]['company_name']."</span>";

?>

<?=($currency_info['currency_symbol']?$currency_info['currency_symbol']:$conf->price_handler).number_format($currency_info['exchange_rate']*$cart->getShippingAmountWithoutTax(),2,'.','')?>

<? $val2 = number_format($cart->getShippingAmountWithoutTax(),2,'.','')?>

<? $_SESSION['s_ship_wotax'] = $val2 ?></span> </td>

  </tr>

  <tr>

<td height="20" align="right" class="tblCartBg2" ><span class="txtInvoiceCart">Order Total:</span></td>

<td align="right" class="tblCartBg2" ><span class="txtPriceCart">

<?

$fv = $gt+$val2+$val3;

echo ($currency_info['currency_symbol']?$currency_info['currency_symbol']:$conf->price_handler).number_format($currency_info['exchange_rate']*$fv,2,'.','');

$_SESSION["final_values"] = $fv;

?></span></td>

  </tr>

  </table>

  <? } ?>

 

  </td>

</tr>

</table></td>

  </tr>

  <tr>

<td height="8" valign="top"></td>

  </tr>

  <tr>

<td valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">

<tr>

  <td height="40" colspan="2" align="right"><img src="../New Folder/images/cart/contshopbtn.gif" alt="Continue Shopping" width="113" height="28" border="0" style="cursor:pointer;" onClick="refreshThis('<?=$_SESSION['client_continue_shopping']?>')" /> <img src="../New Folder/images/cart/upcartbtn.gif" alt="Update Cart" width="113" height="28" border="0" style="cursor:pointer;" onClick="doSubmit()" /> <img src="../New Folder/images/cart/clearcartbtn.gif" alt="Clear Cart" width="113" height="28" border="0" style="cursor:pointer;" onClick="refreshThis('cart.php?clearCart=yes')" /> <a href="../New Folder/login.php"><img src="../New Folder/images/cart/chkoutbtn.gif" alt="Checkout" width="113" height="28" border="0" style="cursor:pointer;"/></a></td>

</tr>

</table></td>

  </tr>

  </form>

</table></td>

  </tr>

  <? } else { ?>

  <tr>

  <td align="center" class="error">No Item in Cart.<br />

        <br>

        <?

if($message!="")

{

//echo $message;

}

if($cart->LastMsg!=null)

 

//echo $cart->LastMsg;

?></td>

  </tr>

  <? } ?>

</table>

 

 

<table width="97%" border="0" align="right" cellpadding="0" cellspacing="0">

  <tr>

<td height="10" ></td>

  </tr>

 

  <tr>

<td height="30"><span class="txttitle_1">Shipping Cart</span></td>

  </tr>

  <tr>

<td> </td>

  </tr>

  <tr>

  <td align="center" class="error">No Item in Cart.<br />

        <br>

        <?

if($message!="")

{

//echo $message;

}

if($cart->LastMsg!=null)

 

//echo $cart->LastMsg;

?></td>

  </tr>

</table>

 

<? } ?><?php ?>

 

    <?

   

    $cart->destroy_cart();

   

    $products->destroy_client_products();

    //echo '<p><pre>'; var_export($_SESSION);

    include_once("footer.php");

$totalpros = 0;

if($_SESSION['cart_code']){

$total_items = 0;

$total_price = 0;

foreach(unserialize($_SESSION['quantity']) as $pros){

$totalpros += $pros ;

}

}

    ?>

    <script language="javascript">

if("<?=count(unserialize($_SESSION['cart_code']))?>" > 0){

//document.getElementById("total_items").innerHTML = "<?//=$totalpros?>";

//document.getElementById("total_price").innerHTML = "<?//=($currency_info['currency_symbol']?$currency_info['currency_symbol']:$conf->price_handler).number_format($fv,2,'.','');?>";

}

 

    selectComboOption(document.update.country_id,"<?=$_SESSION['s_country_id']?>");

   

    </script>

The code is working you can check out

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.