Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

box shopping_cart


easybeau

Recommended Posts

Hi,

 

I put box shopping_cart.php in header like this:

 

caddie.gif View my basket

'empty' or 1 article(s)

 

See online

The text 'empty' and numbers of articles are not shown and should appear when a product is added in basket!

 

Where is the mistake?

 

<!-- shopping_cart //-->
	  <tr>
		<td>
<?php
 $cart_contents = array();
 $cart_contents[] = array('text' =>'<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . tep_image(DIR_WS_IMAGES . 'caddie.gif') . VIEW_BOX_SHOPPING . '</a><br>');

 //new basketBox($info_box_contents, false, false, tep_href_link(FILENAME_SHOPPING_CART));

 $cart_contents_string = '';
 if ($cart->count_contents() > 0) {
 $cart_contents_string .=' Aricles </span></td>';
 $cart_contents_string .=' Aricle </span></td>';
 $cart_contents_string .= BOX_SHOPPING_CART_EMPTY;
 $products = $cart->get_products();
}	   
 new basketBox($cart_contents);
?>
		</td>
	  </tr>
<!-- shopping_cart_eof //-->

 

I need help, thanks!

Link to comment
Share on other sites

Save what you have as a backup, but I think this will work ...

 

<!-- shopping_cart //-->
	  <tr>
		<td>
<?php
 $cart_contents_string = '';
if ($cart->count_contents() == 0)
{
$cart_contents_string = BOX_SHOPPING_CART_EMPTY;
}
elseif ($cart->count_contents() == 1)
{
$cart_contents_string = ' 1 Aricle </span></td>';
}
else
{
$cart_contents_string = $cart->count_contents(). ' Aricles </span></td>';
}

 $cart_contents = array();
 $cart_contents[] = array('text' =>'<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . tep_image(DIR_WS_IMAGES . 'caddie.gif') . VIEW_BOX_SHOPPING . '</a><br>' . $cart_contents_string);

 //new basketBox($info_box_contents, false, false, tep_href_link(FILENAME_SHOPPING_CART));

 //$products = $cart->get_products();

 new basketBox($cart_contents);
?>
		</td>
	  </tr>
<!-- shopping_cart_eof //-->

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...