Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Modification to shopping_cart.php box needed...


atech

Recommended Posts

Posted

i downloaded the Contribution "Add Shopping Cart Info to Your Header", and what i want to do is replace my old catalog/includes/boxes/shopping_cart.php code with the one below:

 

<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>

 

The code above is from the Add Shopping Cart Info to Your Header Contribution.

 

also what i would like to do is, is remove the cart contents and the checkout link that is in the catalog/includes/header.php file and put it in the catalog/includes/boxes/shopping_cart.php file, so it would look something like this:

 

----------------

|items: 0      |

|total: $0.00  |

|              |

|Cart Contents |

|Checkout      |

----------------

Thats the way i would like my catalog/includes/boxes/shopping_cart.php

 

I am sure there is a way to do it like that, any help would be great. I think i explained right.

 

Thanks for any help!

Posted

any help would be great. I have been working with it and working with it, but i just cant figure it out. I feel like i am playing guessing games with the code. :?

Posted

Hi -

 

As far as the Shopping Cart Infobox problem you mentioned, we used the following solution. The lines shown below replace the originals (at about Lines 62 to 70 or so) in /catalog/include/boxes/shopping_cart.php:

$info_box_contents = array();

$info_box_contents[] = array('text' => $cart_contents_string);

 

if ($cart->count_contents() > 0) {

$info_box_contents[] = array('text' => tep_draw_separator());

$info_box_contents[] = array('align' => 'left',

'text' => 'Items in Cart: ' . ' ' . $cart->count_contents() . '<p>' . 'Cart-Total: ' . ' ' . $currencies->format($cart->show_total()));

}

This should produce a shopping cart infobox that looks something like this:

________________

 

Items in Cart: x

Cart-Total: $xx.xx

________________

 

Seems to increment and decrement properly when items are put in and taken out of the cart.

 

My wife and I are newbies at this, too. :-) Hope this is of some use to you. Good luck.

Archived

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

×
×
  • Create New...