Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

display "checkout" button on product page


Guest

Recommended Posts

Posted

how could i display a "checkout" button next to "add to cart" on product_info.php if the cart quanity is greater than 0

 

i assume the code if ($cart->count_contents() > 0) { would be used, but i'm not sure how to incorperate it.

Posted

how can i make

<?php if ($cart->count_contents() > 0) {

<?php echo '<a href="' . tep_href_link(FILENAME_CHECOUT_SHIPPING, '', 'SSL') . '"><img src="includes/languages/english/images/buttons/checkout_now.gif" alt="checkout now" border="0"></a>'; ?>

}

 

work properly? i'm not much good with php, and to me this does not look correct at all.

 

i'm looking at boxes/shopping_cart.php as an example and i cannot figure out which parts i need and don't need. the only parts i'm familiar with are html

Posted

Here's the code from my store. It has some further customization (such as displaying number of items in the cart in the header, value retrieved earlier), but you should get the idea.

	<td align="right" class="headerNavigation"><?php if ($session_started) { if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a>  |  <?php }
 else {?><a href="<?php echo tep_href_link(FILENAME_LOGIN, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGIN; ?></a>  |  <?php }
 ?><a href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS . ' (' . $ncart . ' item';
 if ($ncart != 1) echo 's'; ?>)</a>
 <?php if ($ncart > 0) {?> |  <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; ?></a><?php } }?>  </td>

 

All of these links are suppressed if there is no session.

  • 4 weeks later...
Posted

i'm not sure what to do with:

<?php if ($ncart > 0) {?>

 

 

i don't think i have an "ncart"?

Archived

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

×
×
  • Create New...