Guest Posted January 15, 2006 Posted January 15, 2006 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.
stevel Posted January 15, 2006 Posted January 15, 2006 You're almost there. If that condition is true, put out the HTML that displays the checkout button with a link (using tep_href_link and the SSL argument) to FILENAME_CHECKOUT_SHIPPING. Steve Contributions: Country-State Selector Login Page a la Amazon Protection of Configuration Updated spiders.txt Embed Links with SID in Description
Guest Posted January 16, 2006 Posted January 16, 2006 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
stevel Posted January 16, 2006 Posted January 16, 2006 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. Steve Contributions: Country-State Selector Login Page a la Amazon Protection of Configuration Updated spiders.txt Embed Links with SID in Description
Guest Posted February 12, 2006 Posted February 12, 2006 i'm not sure what to do with: <?php if ($ncart > 0) {?> i don't think i have an "ncart"?
stevel Posted February 12, 2006 Posted February 12, 2006 $ncart = $cart->count_contents(); Steve Contributions: Country-State Selector Login Page a la Amazon Protection of Configuration Updated spiders.txt Embed Links with SID in Description
Recommended Posts
Archived
This topic is now archived and is closed to further replies.