Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Shopping Cart + Checkout Conditional


SharleneK

Recommended Posts

Posted

Is it possible to configure things so that the "Shopping Cart" and "Checkout" options in the header only exist/appear when a customer has added something to the cart?

 

Or is there a workaround that allows me to eliminate the header, have those functions exist independently under that condition?

 

Any help will be appreciated. Thanks ahead of time!

Sharlene K.

 

Did you hear about the dyslexic agnostic insomniac that stayed up all night wondering if there was a dog?

Posted

In 'includes/header.php' find the line:

 

	<td align="right" valign="bottom"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', HEADER_TITLE_MY_ACCOUNT) . '</a>  <a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . tep_image(DIR_WS_IMAGES . 'header_cart.gif', HEADER_TITLE_CART_CONTENTS) . '</a>  <a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_CHECKOUT) . '</a>'; ?>  </td>

 

And replace it with:

 

	<td align="right" valign="bottom"><?php
	echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', HEADER_TITLE_MY_ACCOUNT) . '</a>';

	if($cart->count_contents() > 0) echo '  <a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . tep_image(DIR_WS_IMAGES . 'header_cart.gif', HEADER_TITLE_CART_CONTENTS) . '</a>  <a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_CHECKOUT) . '</a>';
?>  </td>

Archived

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

×
×
  • Create New...