Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Shopping Cart Icon and Contents in Header


oscommercenewbie

Recommended Posts

Hi All,

I wonder if anyone else has put the shopping cart icon and contents of the shopping cart in header?

 

I want my header to look like another oscommerce site Site

 

When the cart is empty, it will say now in your cart 0 items

When it has products, it will say now in your cart 1 items

 

I have tried the contribution shopping cart in header but I cant make the code fit properly. Has anyone done this? Made the header look like the website above?

 

If so, would you be willing to share the code?

 

Thank you for your time!

Link to comment
Share on other sites

Hi,

Try something like this:

	<table><tr><td>
 <?php echo '<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . tep_image(DIR_WS_IMAGES 'icon_cart.gif', '', '16', '16', 'align="absmiddle"') . '</a>?' . BOX_HEADING_SHOPPING_CART;?></td></tr>
<tr><td height="2"></td></tr>
<tr><td><?php echo HEADER_TITLE_CART_CONTENTS . ':?<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . $cart->count_contents() . '?items</a>'; ?></td></tr></table>

 

and change the image name to whatever you need.

Link to comment
Share on other sites

Hi Allison,

Sorry - I missed a dot in the code. Here, try again:

<table><tr><td>
<?php echo '<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . tep_image(DIR_WS_IMAGES . 'icon_cart.gif', '', '16', '16', 'align="absmiddle"') . '</a> ' . BOX_HEADING_SHOPPING_CART;?></td></tr>
<tr><td height="2"></td></tr>
<tr><td><?php echo HEADER_TITLE_CART_CONTENTS . ': <a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . $cart->count_contents() . ' items</a>'; ?></td></tr></table>

 

Add your own icon_cart.gif image and some style formatting, and you've got it.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...