Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to add shopping cart to header


jonah

Recommended Posts

I have searched and I cannot find how to add the shopping cart to the header. I am trying to do something similar to this:

http://business-bali.com/test/catalog/cata...log/default.php

(without the weight listing)

 

Is there a contribution to help do this? or can someone point me to some code since this has to have been mentioned before in the forums. I searched the forums to no avail (the forums really need some more advanced searching features).

Link to comment
Share on other sites

Hi,

 

That site does not have a working shopping cart that is the picture.

 

Is this what you want or do you want the picture linked to the shopping cart or the shopping cart box that shows what's in the cart in the header?

 

You can put a graphic in the header and just link it to the shopping_cart.php

Link to comment
Share on other sites

I would like to get rid of the shopping cart box and move it to the header and have it displayed there. A working one though, not just a picture. With so many boxes that are of use, it would seem to make sense to utilize the space in the header. Can this be done?

Link to comment
Share on other sites

Here's what I have been using in my header for quite a while. You'll probably need to change the CSS classes. It has the item count and merchandise total. Enjoy!

 

<table align="right" class="infoBox" width="140" border="0" cellspacing="1" cellpadding="1">

<tr>

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

	 Items:

 </td>

 <td class="accountCategory" align="left">

	 <?php echo $cart->

	 count_contents(); ?>  

 </td>

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

	 Total:

 </td>

 <td class="accountCategory" align="left">

	 <?php echo $currencies->

	 format($cart->show_total()); ?>

 </td>

</tr>

</table>

Link to comment
Share on other sites

Here's what I have been using in my header for quite a while. You'll probably need to change the CSS classes. It has the item count and merchandise total. Enjoy!

 

<table align="right" class="infoBox" width="140" border="0" cellspacing="1" cellpadding="1">

<tr>

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

	 Items:

 </td>

 <td class="accountCategory" align="left">

	 <?php echo $cart->

	 count_contents(); ?>  

 </td>

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

	 Total:

 </td>

 <td class="accountCategory" align="left">

	 <?php echo $currencies->

	 format($cart->show_total()); ?>

 </td>

</tr>

</table>

 

Is this code the same as the "Add Shopping Cart Info to Your Header" contribution you made?

 

http://www.oscommerce.com/community/contributions,1079

Link to comment
Share on other sites

I tried the code and got it to work somewhat, but the problem that I had is that it is hidden behind the navigation bar. I assume that it is because the "oscommerce.gif" is forcing it to be on the next lower line.

Link to comment
Share on other sites

Good morning everyone!

 

Bear,

 

Is it just not showing or it is not picking up the contents of your cart?

 

 

 

Lonnie,

 

You can take the "echos" out of the table or rearrange the HTML so that the echos are stacked etc.

Link to comment
Share on other sites

Bear,

 

Find the   </td> after the last .gif. Add a <br> between the    and the </td>, so it looks like this:   <br></td> . Now paste the cart <table> between the <br> and the </td>. Last, remove the class="infobox" from the <table>.

Link to comment
Share on other sites

Bear,

 

To stack the item count and total add </tr><tr> in between the two columns.

 

  <td class="main" align="left">

	 <?php echo $cart->

	 count_contents(); ?>  

 </td>

</tr>

<tr>

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

	 Total:

 </td>

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...