Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Shopping Cart "Continue Shopping" button doesn't show up anymore


aelalfy1989

Recommended Posts

Posted

Hi Everyone,

 

I was wondering if someone can help me figure out whats wrong with my "continue shopping" button that disappears. I don't know what I did but I didn't change much and for a while it appeared fine. Its in my shopping cart page at the bottom, next to the "update" button & "checkout" button. Here is the code, I'm having a hard time understanding why. I see there is an if function that controls if the button shows or not. Also there is a variable called "$back". Maybe rearranging these or rewriting them can get it to work but for me it doesn't work. Here is the link to the shopping cart : http://www.bestmacdiscounts.com/shopping_cart.php And finally the code to that site. Thanks in advance and hope someone can help

 

<?php
/*
 $Id: shopping_cart.php,v 1.73 2003/06/09 23:03:56 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require("includes/application_top.php");


 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SHOPPING_CART);

 $breadcrumb->add(NAVBAR_TITLE);
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?> - <?php echo strip_tags($breadcrumb->trail(' ª ')); ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<!--[if IE 7]> <link href="ie.css" rel="stylesheet" type="text/css"> <![endif]-->
<!--[if IE 8]> <link href="ie8.css" rel="stylesheet" type="text/css"> <![endif]-->
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<div id="cidiKA" style="z-index:100;position:absolute"></div>
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="0" cellpadding="0" style="table-layout:fixed">
 <tr>
<!-- body_text //-->
   <td width="100%" class="col_center">
<div id="breadcrumb_wrap">
<ul id="breadcrumb">
       <li><a href="http://www.bestmacdiscounts.com" title="Home"><img src="images/home.png" alt="Home" class="home" /></a></li>
       <li><?php echo $breadcrumb->trail('   ')?></li>
</ul>
<div>
 <div id="ddtabs1" class="basictab">
<ul>
<li><!-- BEGIN ProvideSupport.com Text Chat Link Code -->
<div id="scdiKA" style="display:inline"></div><div id="sddiKA" style="display:none"></div><script type="text/javascript">var sediKA=document.createElement("script");sediKA.type="text/javascript";var sediKAs=(location.protocol.indexOf("https")==0?"https":"http")+"://image.providesupport.com/js/aelalfy1989/safe-textlink.js?ps_h=diKA&ps_t="+new Date().getTime()+"&online-link-html=Live%20Help&offline-link-html=Live%20Help";setTimeout("sediKA.src=sediKAs;document.getElementById('sddiKA').appendChild(sediKA)",1)</script><noscript><div style="display:inline"><a href="http://www.providesupport.com?messenger=aelalfy1989">Online Chat</a></div></noscript>
<!-- END ProvideSupport.com Text Chat Link Code --></li>
<li><a href="<?php echo tep_href_link('account.php')?>">Account</a></li>
<li><a href="<?php echo tep_href_link('shopping_cart.php')?>">Cart <?php echo $cart->count_contents()?><img src="images/cart.png" width="22" height="16" style="vertical-align:middle; border:0px;" /></a></li>
</ul>
</div>
</div>
</div>
<DIV style="margin-top:10px">
<?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_SHOPPING_CART, 'action=update_product')); ?>
<table border="0" cellspacing="0" cellpadding="0" width="600px" style="table-layout:fixed">
     <tr>
       <td>

<?php
$info_box_contents = array();
 $info_box_contents[] = array('align' => 'left', 'text' => sprintf('<span style="color:#fff; font-family: Lucida Grande, Lucida Sans Unicode, Arial, Verdana, sans-seri; font-size:12px; font-weight:bold;">Items in Your Cart</span>', strftime('%B')));
new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_SPECIALS));
?>

<?php tep_draw_heading_top_3();?>



<?php
 if ($cart->count_contents() > 0) {
?>

<?php
   $info_box_contents = array();
   $info_box_contents[0][] = array('align' => 'center',
                                   'params' => ' class="shop_cart remove"',
                                   'text' => ''.TABLE_HEADING_REMOVE.'');

   $info_box_contents[0][] = array('align' => 'center',
								'params' => ' class="shop_cart products"',
                                   'text' => ''.TABLE_HEADING_PRODUCTS.'');

   $info_box_contents[0][] = array('align' => 'center',
                                   'params' => ' class="shop_cart quantity"',
                                   'text' => ''.TABLE_HEADING_QUANTITY.'');

   $info_box_contents[0][] = array('align' => 'center',
                                   'params' => ' class="shop_cart total"',
                                   'text' => ''.TABLE_HEADING_TOTAL.'');

   $any_out_of_stock = 0;
   $products = $cart->get_products();
   for ($i=0, $n=sizeof($products); $i<$n; $i++) {
// Push all attributes information in an array
     if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
       while (list($option, $value) = each($products[$i]['attributes'])) {
         echo tep_draw_hidden_field('id[' . $products[$i]['id'] . '][' . $option . ']', $value);
         $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix
                                     from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa
                                     where pa.products_id = '" . (int)$products[$i]['id'] . "'
                                      and pa.options_id = '" . (int)$option . "'
                                      and pa.options_id = popt.products_options_id
                                      and pa.options_values_id = '" . (int)$value . "'
                                      and pa.options_values_id = poval.products_options_values_id
                                      and popt.language_id = '" . (int)$languages_id . "'
                                      and poval.language_id = '" . (int)$languages_id . "'");
         $attributes_values = tep_db_fetch_array($attributes);

         $products[$i][$option]['products_options_name'] = $attributes_values['products_options_name'];
         $products[$i][$option]['options_values_id'] = $value;
         $products[$i][$option]['products_options_values_name'] = $attributes_values['products_options_values_name'];
         $products[$i][$option]['options_values_price'] = $attributes_values['options_values_price'];
         $products[$i][$option]['price_prefix'] = $attributes_values['price_prefix'];
       }
     }
   }

   for ($i=0, $n=sizeof($products); $i<$n; $i++) {
     if (($i/2) == floor($i/2)) {
       $info_box_contents[] = array('params' => 'class=""'); //  background place  
     } else {
       $info_box_contents[] = array('params' => 'class=""'); //  background place 
     }

     $cur_row = sizeof($info_box_contents) - 1;

     $info_box_contents[$cur_row][] = array('align' => 'center',
                                            'params' => ' class="remove"',
                                            'text' => '<br style="line-height:75px">'.tep_draw_checkbox_field('cart_delete[]', $products[$i]['id']));

     $products_name = '

				<table cellpadding="0" cellspacing="0" border="0">
					<tr>

						 <td style="height:102px;" align="center" class="vam"><table cellpadding="0" cellspacing="0" border="0" style="width:178px"><tr><td><br style="line-height:5px;">
							<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">' . tep_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT) . '</a></td></tr></table>
						 </td>
						 <td style="width:100%">
							<br style="line-height:10px">
							<em>' . substr($products[$i]['name'],0,MAX_DESCR_NAME_SHOPPCART) . '</em>';



     if (STOCK_CHECK == 'true') {
       $stock_check = tep_check_stock($products[$i]['id'], $products[$i]['quantity']);
       if (tep_not_null($stock_check)) {
         $any_out_of_stock = 1;

         $products_name .= $stock_check;
       }
     }

     if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
       reset($products[$i]['attributes']);
       while (list($option, $value) = each($products[$i]['attributes'])) {
         $products_name .= '<br style="line-height:1px;"><small><i> - ' . $products[$i][$option]['products_options_name'] . ' ' . $products[$i][$option]['products_options_values_name'] . '</i></small>';
       }
     }	
	$products_name .= '												
						</td>						

					</tr>
				</table><br style="line-height:5px;">
				';


     $info_box_contents[$cur_row][] = array('params' => ' class="products"',
                                            'text' => $products_name);

     $info_box_contents[$cur_row][] = array('align' => 'center',
                                            'params' => ' class="quantity"',
                                            'text' => '<br style="line-height:15px">'.tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4" id="input1"') . tep_draw_hidden_field('products_id[]', $products[$i]['id']));

     $info_box_contents[$cur_row][] = array('align' => 'center',
                                            'params' => ' class="total"',
                                            'text' => '<br style="line-height:15px"><span class="productSpecialPrice">' . $currencies->display_price($products[$i]['final_price'], tep_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']) . '</span>');
   }

  new productListingBox($info_box_contents);
?>

<?php
   if ($any_out_of_stock == 1) {
     if (STOCK_ALLOW_CHECKOUT == 'true') {
?>
     <table cellpadding="0" cellspacing="0" border="0">
  		<tr><td class="stockWarning" align="center"><br><?php echo OUT_OF_STOCK_CAN_CHECKOUT; ?></td></tr>
  </table>
<?php
     } else {
?>
     <table cellpadding="0" cellspacing="0" border="0">
  		<tr><td class="stockWarning" align="center"><br><?php echo OUT_OF_STOCK_CANT_CHECKOUT; ?></td></tr>
  </table>
<?php
     }
   }
?>
<table cellpadding="0" width="90%" cellspacing="0" border="0"><tr><td class="bg_gg"><?php echo tep_draw_separator('spacer.gif'); ?></td></tr></table>

			<table cellspacing="0" cellpadding="0" border="0" class="product">
				<tr>
					<td width="80%" align="right" style="vertical-align:middle;text-align:right; height:38px;"><strong><?php echo SUB_TITLE_SUB_TOTAL; ?></strong>       </td>
					<td width="20%" align="center" style=" vertical-align:middle;">														
						<span class="productSpecialPrice"><?php echo $currencies->format($cart->show_total()); ?></span>
					</td>
				</tr>
			</table>

<table cellpadding="0" cellspacing="0" border="0"><tr><td class="bg_gg"><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></td></tr></table>		

			<table cellspacing="0" cellpadding="0" border="0" >
				<tr>
					<td width="10%" style="padding:10px 0px 0px 20px;" class="padd33 bg_input"><?php echo tep_image_submit('button_update.gif', IMAGE_BUTTON_UPDATE_CART); ?></td><td style="padding:10px 0px 0px 0px;" class="padd33 bg_input" align="left" ><?php

				$back = sizeof($navigation->path)-2;
				if (isset($navigation->path[$back])) {

			echo '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_image_button('button_continue_shopping1.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>'; 
			}
			?></td><td style="padding:10px 20px 0px 20px;" class="padd33 bg_input" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image_button('button_checkout.gif', IMAGE_BUTTON_CHECKOUT) . '</a>'; ?></td>
				</tr>
				<tr><td height="16"></td></tr>
			</table>		

<?php
 } else {
?>
<?php /*  tep_draw_heading_top_1();  */?>      
   <br style="line-height:1px;"><br style="line-height:5px;">


		<table border="0" width="82%" cellspacing="0" cellpadding="2">
             <tr>
		  	<td></td>
			<td align="center" width="100%"><br><?php new infoBox_77(array(array('text' => TEXT_CART_EMPTY))); ?></td>
			<td></td>
		  </tr>
		  <tr>
               <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td align="right" class="main" width="100%"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?><br><br></td>
               <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
             </tr>  <tr height="10">
               <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td></tr>
           </table>
<?php
 }
?>

<?php tep_draw_heading_bottom_3();?>
</td>
<td style="padding-left:8px;" style="table-layout:fixed" width=177px>
<?php require(DIR_WS_INCLUDES . 'column_right2.php'); ?>
</td>
   </table></form></td>
<!-- body_text_eof //-->
   </DIV>
 </tr>

</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</table>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Thank you in advance,

AE

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...