Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / 2nd "Add To Cart" button

2nd "Add To Cart" button

Views: 735

Results 1 to 4 of 4
3 Aug 2011, 2:40 PM
#1
wilson_li avatar

wilson_li

New Zenner

Join Date:
Jul 2011
Location:
New Jersey
Posts:
98
Plugin Contributions:
0

2nd "Add To Cart" button

Hello All,

Is there possible to add second "Add To Cart" button at the bottom of the last images in my product info page? I tried the way provided by "haredo" http://www.zen-cart.com/forum/showthread.php?t=94000 it doesn't work.....

Here is one of my product info page: http://www.oleklejbzon.com/campbellsloft3/index.php?main_page=product_info&cPath=2&products_id=39

Thanks

3 Aug 2011, 2:46 PM
#2
dgent avatar

dgent

Totally Zenned

Join Date:
Nov 2009
Location:
UK
Posts:
1,117
Plugin Contributions:
0

Re: 2nd "Add To Cart" button

Go into your template folder and find the file tpl_product_info_display.php

Find this...

<!--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-->

Copy and paste it before <!--bof Prev/Next bottom position -->

3 Aug 2011, 2:55 PM
#3
wilson_li avatar

wilson_li

New Zenner

Join Date:
Jul 2011
Location:
New Jersey
Posts:
98
Plugin Contributions:
0

Re: 2nd "Add To Cart" button

dgent:

Go into your template folder and find the file tpl_product_info_display.php

Find this...

<!--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-->

Copy and paste it before <!--bof Prev/Next bottom position -->

Thanks dgent, it works! :clap:

btw, is there possible to put the product title, product description and product price below the first image inside the product info page?

Here is the link:
http://www.oleklejbzon.com/campbellsloft3/index.php?main_page=product_info&cPath=2&products_id=4

Please take a look at the attachment