Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Customizing the Look of Your Shop / Templates, Stylesheets, Page Layout / Where is the template to adjust how the Add to Cart button looks?

Where is the template to adjust how the Add to Cart button looks?

Locked

Started by bugyoutoo on 3 Mar 2008, 11:04 PM · Views: 1,057

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
3 Mar 2008, 11:04 PM
#1
bugyoutoo avatar

bugyoutoo

New Zenner

Join Date:
Nov 2007
Posts:
34
Plugin Contributions:
0

Post #1 by bugyoutoo

Currently the Quantity button is right above the Add to Cart button (vertically). I'd like to have them both on a horizontal line, so.. "Quantity X, Add to Cart". I've looked through the templates and can't seem to find it.

To note on what I did: In tpl_product_info_display, it seems to be calling the include from somewhere else since as soon as I move some quantity code, both quantity and add to cart are removed.

3 Mar 2008, 11:09 PM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Post #2 by gjh42

All you need to do is remove some <br /> tags from the code in tpl_product_info_display.php. You may also need to eliminate some
. '
or
' .
to make the PHP code correct.

3 Mar 2008, 11:28 PM
#3
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Post #3 by gjh42

This is how I did it for my store:

<?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  gjh42 4/13/06 - chg box layout to horiz. 20070507 - add button id
    $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" />' . zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '<span id="cartAddButton">' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</span>';
            }
    $display_button = zen_get_buy_now_button($_GET['products_id'], $the_button);
  ?>
4 Mar 2008, 6:38 AM
#4
bugyoutoo avatar

bugyoutoo

New Zenner

Join Date:
Nov 2007
Posts:
34
Plugin Contributions:
0

Post #4 by bugyoutoo

gjh42:

This is how I did it for my store:

<?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 gjh42 4/13/06 - chg box layout to horiz. 20070507 - add button id $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" />' . zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '<span id="cartAddButton">' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</span>'; } $display_button = zen_get_buy_now_button($_GET['products_id'], $the_button); ?>

Wow thanks, that worked like a charm too!