Forums / Setting Up Categories, Products, Attributes / How to add "add to cart" button at multiple places?

How to add "add to cart" button at multiple places?

Locked

Started by libran1979 on 26 Feb 2009, 6:30 AM · Views: 1,125

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
26 Feb 2009, 6:30 AM
#1
libran1979 avatar

libran1979

New Zenner

Join Date:
Feb 2009
Posts:
1
Plugin Contributions:
0

How to add "add to cart" button at multiple places?

Hi,
I currently have the "add to cart" button at the bottom of the page in product info page.

I want to have a add to cart button on the top of the page too. Can anyone help me how to do this?

Thanks in Advance.
Carbon

26 Feb 2009, 8:09 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: How to add "add to cart" button at multiple places?

In a copy of tpl_product_info_display.php for your template open it and see the following code block and the order it is in....copy all of this and paste into the position/order you want the additional box

<!--bof Add to Cart Box -->
<?php
if (CUSTOMERS_APPROVAL == 3 and TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE_SHOWROOM == '') {
  // do nothing
} else {
?>
            <?php
    $display_qty = (($flag_show_product_info_in_cart_qty == 1 and $_SESSION['cart']->in_cart($_GET['products_id'])) ? '<p>' . PRODUCTS_ORDER_QTY_TEXT_IN_CART . $_SESSION['cart']->get_quantity($_GET['products_id']) . '</p>' : '');
            if ($products_qty_box_status == 0 or $products_quantity_order_max== 1) {
              // hide the quantity box and default to 1
              $the_button = '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
            } else {
              // show the quantity box
    $the_button = PRODUCTS_ORDER_QTY_TEXT . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '<br />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
            }
    $display_button = zen_get_buy_now_button($_GET['products_id'], $the_button);
  ?>
  <?php if ($display_qty != '' or $display_button != '') { ?>
    <div id="cartAdd">
    <?php
      echo $display_qty;
      echo $display_button;
            ?>
          </div>
  <?php } // display qty and button ?>
<?php } // CUSTOMERS_APPROVAL == 3 ?>
<!--eof Add to Cart Box-->

Zen-Venom Get Bitten

26 Feb 2009, 10:15 AM
#3
fairestcape avatar

fairestcape

Totally Zenned

Join Date:
Mar 2008
Location:
Cape Town &amp; London (depends on the season)
Posts:
2,957
Plugin Contributions:
0

Re: How to add "add to cart" button at multiple places?

Bear in mind, however, that if you have Quantity Select Box active, your customers may end up with confusing quantities in their shopping cart...

... what do I mean, exactly?

Let's say you have an ADD TO CART at the top of the page, and another at the bottom of the page.

You have QUANTITY SELECT BOXES on both, probably with the default "1" showing.

If your customers scroll down to the bottom, and put "3" in the bottom box, then add to cart, the default (as yet unchanged) number in the TOP box will over-ride this and "1" will be written to the order. So, even thought they selected 3 items at the bottom box, only "1" will show in the subsequent shopping cart.

This is not a huge issue... you could add a line of text to the shopping cart alerting customers to check (and change if necessary), their order quantities.