Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / General Questions / Need to align "Quantity Discount" table w/ "add to cart" button

Need to align "Quantity Discount" table w/ "add to cart" button

28 Feb 2015, 2:55 AM
#1
marvin avatar

marvin

Zen Follower

Join Date:
Feb 2006
Posts:
222
Plugin Contributions:
0

Post #1 by marvin

This is on my Product Info pages.

Need to align "Quantity Discount" table w/ "add to cart" button. I have them near each other but not aligned opposite each other. I've tried all the coding I can think of in the includes/templates/my_templates/templates/ Products_info_display.php file but no luck.

Here is a link to one of my product pages: http://www.sourceforherbs.com/Classic-Formulas/Clear-Mountain-Air-Teapills-Ding-Chuan-Wan

Please help.

Thanks in advance.

28 Feb 2015, 4:02 AM
#2
southshorepizza avatar

southshorepizza

Zen Follower

Join Date:
Sep 2012
Posts:
253
Plugin Contributions:
0

Post #2 by southshorepizza

Just a quick look. May have to tweak the code a little as I haven't tested it. but…

<!--bof Add to Cart Box -->
<?php
if (CUSTOMERS_APPROVAL == 3 and TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE_SHOWROOM == '') {
  // do nothing
} else {
?>
<!--bof Quantity Discounts table -->
<?php
  if ($products_discount_type != 0) { ?>
<?php
/**
 * display the products quantity discount
 */
 require($template->get_template_dir('/tpl_modules_products_quantity_discounts.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_products_quantity_discounts.php'); ?>
<?php
  }
?>
<!--eof Quantity Discounts table -->
            <?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-->

should put it inside the box just above the add to cart quantity then it would always be aligned.

28 Feb 2015, 4:50 AM
#3
marvin avatar

marvin

Zen Follower

Join Date:
Feb 2006
Posts:
222
Plugin Contributions:
0

Post #3 by marvin

thanks for your reply.
I see what you did. I removed original and moved this into the file but nothing is different.

1 Mar 2015, 4:08 AM
#4
marvin avatar

marvin

Zen Follower

Join Date:
Feb 2006
Posts:
222
Plugin Contributions:
0

Post #4 by marvin

Solved it myself.
Just added <table><td> before the Quantity Discount coding and </table></td> after the Add to Cart button coding.

Thanks.

3 Mar 2015, 11:12 PM
#5
southshorepizza avatar

southshorepizza

Zen Follower

Join Date:
Sep 2012
Posts:
253
Plugin Contributions:
0

Post #5 by southshorepizza

Here is the actual fix. No tables to fix it in zen-cart 1.5.4

 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
 //bof Quantity Discounts table

  if ($products_discount_type != 0) { 

/**
 * display the products quantity discount
 */
 require($template->get_template_dir('/tpl_modules_products_quantity_discounts.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_products_quantity_discounts.php'); 
 }

//eof Quantity Discounts table

      echo $display_qty;
      echo $display_button;
            ?>
          </div>
  <?php } // display qty and button ?>
<?php } // CUSTOMERS_APPROVAL == 3 ?>