Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Changing the Cart/Basket details


warrenerjm

Recommended Posts

Posted

Hi

 

I think this is possible as I have seen it on live shops but I haven't found the answer.

 

How can I have the shopping cart/basket box in the column_right to say the following:

 

Items : 0

Value :

View Cart (link)

 

At the moment the box just grows & grows down the column. :(

 

Also linked to this ...slightly :P

 

I have noticed some of the BUY NOW buttons put the item in te basket & some go to the product_info.php I still have the default products in the store, but I do not know what is happening & why. I presume it needs fixing but how & where?

 

Thank you for your help.

 

Julie

Posted

Hi

 

Ok from looking at some code from the Better Cart in Header contribution I have "made up" :huh: this code! Not sure if it will do what I want above?

 

<td class="infoBoxContents"><b>Basket Details</b><br>Items: <?php $cart->count_contents()?><br>Sub Total: <?php $currencies->format($cart->show_total())?><br><a class="infoBoxContents" href=<?php tep_href_link('shopping_cart.php')?>><?php $cart-.count_contents()?>View Basket</a></td>

 

I am assuming it needs to go somewhere into the Catalog/includes/boxes/shopping_cart.php but that is where I fall flat on my face :blush:

 

I would really like to change this from showing all the items in basket to just the info above. (using this or a similar code)

 

Please could you help me place it? Please tell me if I have the wrong file too? :rolleyes:

 

Thanks

Julie

Posted

I saw this line in catalog/includes/boxes/shopping cart.php 35

 

	  $cart_contents_string .= $products[$i]['quantity'] . ' x </span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';

 

and replaced it with this line:

 

	  $cart_contents_string .= $products[$i]['quantity'] . ' x </span></td><td valign="top" class="infoBoxContents"><b>Basket Details</b><br>Items: <?php $cart->count_contents()?><br>Sub Total: <?php $currencies->format($cart->show_total())?><br><a class="infoBoxContents" href=<?php tep_href_link('shopping_cart.php')?>><?php $cart-.count_contents()?>View Basket</a></td>';

 

It looked like the right one >_< but I get unexpected T_STRING error!!

 

There are other infoBoxContent places.

 

<?php
/*
 $Id: shopping_cart.php,v 1.18 2003/02/10 22:31:06 hpdl Exp $

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/
?>
<!-- shopping_cart //-->
	  <tr>
		<td>
<?php
 $info_box_contents = array();
 $info_box_contents[] = array('text' => BOX_HEADING_SHOPPING_CART);

 new infoBoxHeading($info_box_contents, false, true, tep_href_link(FILENAME_SHOPPING_CART));

 $cart_contents_string = '';
 if ($cart->count_contents() > 0) {
$cart_contents_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">';
$products = $cart->get_products();
for ($i=0, $n=sizeof($products); $i<$n; $i++) {
  $cart_contents_string .= '<tr><td align="right" valign="top" class="infoBoxContents">';

  if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
	$cart_contents_string .= '<span class="newItemInCart">';
  } else {
	$cart_contents_string .= '<span class="infoBoxContents">';
  }

  $cart_contents_string .= $products[$i]['quantity'] . ' x </span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';

  if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
	$cart_contents_string .= '<span class="newItemInCart">';
  } else {
	$cart_contents_string .= '<span class="infoBoxContents">';
  }

  $cart_contents_string .= $products[$i]['name'] . '</span></a></td></tr>';

  if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
	tep_session_unregister('new_products_id_in_cart');
  }
}
$cart_contents_string .= '</table>';
 } else {
$cart_contents_string .= BOX_SHOPPING_CART_EMPTY;
 }

 $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' => 'right',
							 'text' => $currencies->format($cart->show_total()));
 }

 new infoBox($info_box_contents);
?>
		</td>
	  </tr>
<!-- shopping_cart_eof //-->

 

Anyone fancy giving me a helping hand please? :D

 

Thanks

Julie

Posted

if there are options with the product it will take you to the product info page to choose via the options dropdown menu, if there are no options you can add straight to the basket with buy now button.

Posted
if there are options with the product it will take you to the product info page to choose via the options dropdown menu, if there are no options you can add straight to the basket with buy now button.

Hi Brian

 

Thanks for answering. It doesn't really relate to this but it was another question I had asked about why the Buy Now somethimes adds to the basket & sometimes doeasn't. I don't have attributes so it shouldn't ever go to the product_info page, but that is the other thread.

 

This one is about changing the look of the shopping_cart box contents. I am trying to have it look like the contribution shopping cart in header but in the shopping box & not the header.

 

Thanks

Julie

Archived

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

×
×
  • Create New...