Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Apr 2010
    Posts
    900
    Plugin Contributions
    0

    Default How to control the Quantity Discount Table?

    Hi!

    I want to assert control over the Quantity Discount Table (QDT): what it generates and how it appears.

    I've been playing with this all day, starting to see spots!

    I have managed to get my QDT into the right spot by moving the code up (tpl_product_info_display.php) and adding some table code so that the QDT appears in a cell right next to the Add to Cart blurb. It looks pretty good, so I'm happy with it (love for somebody to look at it and tell me if I messed up any code):
    http://2staging.apswittcosales.com/C...3_4_x_3-1_2_IN

    And I have *kind of* asserted a bit of control over style by working with #productQuantityDiscounts in the css.

    Problem #1
    No matter what I do, I do NOT seem to be able to control the QDT table size (width: 100% or width: 300px)!

    Problem #2 (super frustrating)
    The code that generates this table automatically inserts a new row (<tr>) as soon as 6 price breaks are found. Problem is that some of my manufacturers have as many as 7 breaks. Which ends up looking very awkward:
    http://2staging.apswittcosales.com/M..._2_x_18-1_2_IN

    Just as annoying, if I have 6 price breaks, the code generates a new row (<tr>) and puts nothing in it:
    http://2staging.apswittcosales.com/M..._4_7_INCH_REEL

    I think that the table generating code lives here: tpl_modules_products_quantity_discounts.php

    I want to tell it *NOT* to generate a new row until 10 discounts (basically, never).

    Problem #3 (less important, but I'd still really like to solve)
    I would *LOVE* to simplify the chart (using THIS PAGE as my example)...
    From:
    1-49 | 50-99 | 100-249 | 250-499 | 500-999 | 1,000+

    To:
    1-49 | 50+ | 100+ | 250+ | 500+ | 1,000+

    I would be eternally grateful if someone could take a look!

    Thanks,
    Mike
    Last edited by Feznizzle; 16 Jul 2013 at 10:35 PM. Reason: typeo

  2. #2
    Join Date
    Apr 2010
    Posts
    900
    Plugin Contributions
    0

    Default Re: How to control the Quantity Discount Table?

    tpl_product_info_display.php:
    Code:
    <?php
    
    /**
    
     * Page Template
    
     *
    
     * Loaded automatically by index.php?main_page=product_info.<br />
    
     * Displays details of a typical product
    
     *
    
     * @package templateSystem
    
     * @copyright Copyright 2003-2006 Zen Cart Development Team
    
     * @copyright Portions Copyright 2003 osCommerce
    
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    
     * @version $Id: tpl_product_info_display.php 16242 2010-05-08 16:05:40Z ajeh $
    
     */
    
     //require(DIR_WS_MODULES . '/debug_blocks/product_info_prices.php');
    
    ?>
    
    <?php 
    //BOF :: Tabbed Products Pro ::
    require(DIR_WS_MODULES . 'tabbed_products_pro.php');
    //EOF :: Tabbed Products Pro ::
    ?>
    <div class="centerColumn" id="productGeneral">
    
    
    
    <!--bof Form start-->
    
    <?php echo zen_draw_form('cart_quantity', zen_href_link(zen_get_info_page($_GET['products_id']), zen_get_all_get_params(array('action')) . 'action=add_product', $request_type), 'post', 'enctype="multipart/form-data"') . "\n"; ?>
    
    <!--eof Form start-->
    
    
    
    <?php if ($messageStack->size('product_info') > 0) echo $messageStack->output('product_info'); ?>
    
    
    
    <!--bof Category Icon -->
    
    <?php if ($module_show_categories != 0) {?>
    
    <?php
    
    /**
    
     * display the category icons
    
     */
    
    require($template->get_template_dir('/tpl_modules_category_icon_display.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_category_icon_display.php'); ?>
    
    <?php } ?>
    
    <!--eof Category Icon -->
    
    
    
    <!--bof Prev/Next top position -->
    
    <?php if (PRODUCT_INFO_PREVIOUS_NEXT == 1 or PRODUCT_INFO_PREVIOUS_NEXT == 3) { ?>
    
    <?php
    
    /**
    
     * display the product previous/next helper
    
     */
    
    require($template->get_template_dir('/tpl_products_next_previous.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_products_next_previous.php'); ?>
    
    <?php } ?>
    
    <!--eof Prev/Next top position-->
    
    
    
    <div id="p-right">
    
    <!--bof Main Product Image -->
    
    <?php
    
      if (zen_not_null($products_image)) {
    
      ?>
    
    <?php
    
    /**
    
     * display the main product image
    
     */
    
       require($template->get_template_dir('/tpl_modules_main_product_image.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_main_product_image.php'); ?>
    
    <?php
    
      }
    
    ?>
    
    <!--eof Main Product Image-->
    
    </div>
    
    
    
    
    
    <!--bof Product Name-->
    
    <h1 id="productName" class="productGeneral"><?php echo $products_name; ?></h1>
    
    <!--eof Product Name-->
    
    <!--bof Product details list  -->
    
    <?php if ( (($flag_show_product_info_model == 1 and $products_model != '') or ($flag_show_product_info_weight == 1 and $products_weight !=0) or ($flag_show_product_info_quantity == 1) or ($flag_show_product_info_manufacturer == 1 and !empty($manufacturers_name))) ) { ?>
    
    <ul>
    
      <?php echo (($flag_show_product_info_manufacturer == 1 and !empty($manufacturers_name)) ? '<li>' . TEXT_PRODUCT_MANUFACTURER . $manufacturers_name . '</li>' : '') . "\n"; ?>
    
      <?php echo (($flag_show_product_info_model == 1 and $products_model !='') ? '<li>' . TEXT_PRODUCT_MODEL . $products_model . '</li>' : '') . "\n"; ?>
    
      <?php echo (($flag_show_product_info_weight == 1 and $products_weight !=0) ? '<li>' . TEXT_PRODUCT_WEIGHT .  $products_weight . TEXT_PRODUCT_WEIGHT_UNIT . '</li>'  : '') . "\n"; ?>
    
      <?php echo (($flag_show_product_info_quantity == 1) ? '<li>' . $products_quantity . TEXT_PRODUCT_QUANTITY . '</li>'  : '') . "\n"; ?>
    
    </ul>
    
    <br class="clearBoth" />
    
    <?php
    
      }
    
    ?>
    
    <div id="mikeytable">
    <!--eof Product details list -->
    <table style="width: 100%;">
    <tbody>
    <tr>
    <td>
    <div id="mikeycart">
    
    <!--bof Product Price block -->
    
    <h2 id="productPrices" class="productGeneral">
    
    <?php
    
    // base price
    
      if ($show_onetime_charges_description == 'true') {
    
        $one_time = '<span >' . TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION . '</span><br />';
    
      } else {
    
        $one_time = '';
    
      }
    
      echo $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . zen_get_products_display_price((int)$_GET['products_id']);
    
    ?></h2>
    
    <!--eof Product Price block -->
    
    <!--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-->
    </div>
    </td>
    <td>
    <!--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 -->
    </td>
    </tr>
    </tbody>
    </table>
    </div>
    
    
    <div id='p-right'>
    
    </div>
    
    
    <p>&nbsp;</p>
    
    
    <div id="p-mikey">
    
    <div id="cart">
    
    
    
    
    <!--bof free ship icon  -->
    
    <?php if(zen_get_product_is_always_free_shipping($products_id_current) && $flag_show_product_info_free_shipping) { ?>
    
    <div id="freeShippingIcon"><?php echo TEXT_PRODUCT_FREE_SHIPPING_ICON; ?></div>
    
    <?php } ?>
    
    <!--eof free ship icon  -->
    
    
    <?php 
    //BOF :: Tabbed Products Pro ::
    echo '<div id="tpptabBlock" style="display:none;">' . $tabData . '</div>';
    //EOF :: Tabbed Products Pro ::
    ?>
    
    
    <!--bof Attributes Module -->
    
    <?php
    
      if ($pr_attr->fields['total'] > 0) {
    
    ?>
    
    <?php
    
    /**
    
     * display the product atributes
    
     */
    
      require($template->get_template_dir('/tpl_modules_attributes.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_attributes.php'); ?>
    
    <?php
    
      }
    
    ?>
    
    <!--eof Attributes Module -->
    
    
    
    
    
    
    
    
    </div>
    
    </div>
    
    <br class="clearBoth" /> 
    
    <hr id="product-divider" />
    
    
    
    
    
    
    
     <!--bof Product description -->
    
    <?php if ($products_description != '') { ?>
    
    <div id="productDescription" class="productGeneral biggerText"><?php echo stripslashes($products_description); ?></div>
    
    <?php } ?>
    
    <!--eof Product description -->
    
    <br class="clearBoth" />
    
    
    
    <!-- AddThis Button BEGIN -->
    
    <div class="addthis_toolbox addthis_default_style ">
    
    <a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
    
    <a class="addthis_button_tweet"></a>
    
    <a class="addthis_button_pinterest_pinit"></a>
    
    <a class="addthis_counter addthis_pill_style"></a>
    
    </div>
    
    <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4ff326d22d3b21a9"></script>
    
    <!-- AddThis Button END -->
    
    
    
    <!--bof Additional Product Images -->
    
    <?php
    
    /**
    
     * display the products additional images
    
     */
    
      require($template->get_template_dir('/tpl_modules_additional_images.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_additional_images.php'); ?>
    
    <!--eof Additional Product Images -->
    
    
    
    <!--bof Prev/Next bottom position -->
    
    <?php if (PRODUCT_INFO_PREVIOUS_NEXT == 2 or PRODUCT_INFO_PREVIOUS_NEXT == 3) { ?>
    
    <?php
    
    /**
    
     * display the product previous/next helper
    
     */
    
     require($template->get_template_dir('/tpl_products_next_previous.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_products_next_previous.php'); ?>
    
    <?php } ?>
    
    <!--eof Prev/Next bottom position -->
    
    
    
    <hr id="product-divider" />
    
    
    
    <!--bof Tell a Friend button -->
    
    <?php
    
      if ($flag_show_product_info_tell_a_friend == 1) { ?>
    
    <div id="productTellFriendLink" class="buttonRow forward"><?php echo ($flag_show_product_info_tell_a_friend == 1 ? '<a href="' . zen_href_link(FILENAME_TELL_A_FRIEND, 'products_id=' . $_GET['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_TELLAFRIEND, BUTTON_TELLAFRIEND_ALT) . '</a>' : ''); ?></div>
    
    <?php
    
      }
    
    ?>
    
    <!--eof Tell a Friend button -->
    
    
    
    <!--bof Reviews button and count-->
    
    <?php
    
      if ($flag_show_product_info_reviews == 1) {
    
        // if more than 0 reviews, then show reviews button; otherwise, show the "write review" button
    
        if ($reviews->fields['count'] > 0 ) { ?>
    
    <div id="productReviewLink" class="buttonRow back"><?php echo '<a href="' . zen_href_link(FILENAME_PRODUCT_REVIEWS, zen_get_all_get_params()) . '">' . zen_image_button(BUTTON_IMAGE_REVIEWS, BUTTON_REVIEWS_ALT) . '</a>'; ?></div>
    
    <br class="clearBoth" />
    
    <p class="reviewCount"><?php echo ($flag_show_product_info_reviews_count == 1 ? TEXT_CURRENT_REVIEWS . ' ' . $reviews->fields['count'] : ''); ?></p>
    
    <?php } else { ?>
    
    <div id="productReviewLink" class="buttonRow back"><?php echo '<a href="' . zen_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, zen_get_all_get_params(array())) . '">' . zen_image_button(BUTTON_IMAGE_WRITE_REVIEW, BUTTON_WRITE_REVIEW_ALT) . '</a>'; ?></div>
    
    <br class="clearBoth" />
    
    <?php
    
      }
    
    }
    
    ?>
    
    <!--eof Reviews button and count -->
    
    
    
    
    
    <!--bof Product date added/available-->
    
    <?php
    
      if ($products_date_available > date('Y-m-d H:i:s')) {
    
        if ($flag_show_product_info_date_available == 1) {
    
    ?>
    
      <p id="productDateAvailable" class="productGeneral centeredContent"><?php echo sprintf(TEXT_DATE_AVAILABLE, zen_date_long($products_date_available)); ?></p>
    
    <?php
    
        }
    
      } else {
    
        if ($flag_show_product_info_date_added == 1) {
    
    ?>
    
          <p id="productDateAdded" class="productGeneral centeredContent"><?php echo sprintf(TEXT_DATE_ADDED, zen_date_long($products_date_added)); ?></p>
    
    <?php
    
        } // $flag_show_product_info_date_added
    
      }
    
    ?>
    
    <!--eof Product date added/available -->
    
    
    
    
    
    <!--bof Product URL -->
    
    <?php
    
      if (zen_not_null($products_url)) {
    
        if ($flag_show_product_info_url == 1) {
    
    ?>
    
        <p id="productInfoLink" class="productGeneral centeredContent"><?php echo sprintf(TEXT_MORE_INFORMATION, zen_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($products_url), 'NONSSL', true, false)); ?></p>
    
    <?php
    
        } // $flag_show_product_info_url
    
      }
    
    ?>
    
    <!--eof Product URL -->
    
    
    
    <!--bof also purchased products module-->
    
    <?php require($template->get_template_dir('tpl_modules_also_purchased_products.php', DIR_WS_TEMPLATE, $current_page_base,'templates'). '/' . 'tpl_modules_also_purchased_products.php');?>
    
    <!--eof also purchased products module-->
    
    
    
    <!--bof Form close-->
    
    </form>
    
    <!--bof Form close-->
    </div>
    <?php 
    //BOF :: Tabbed Products Pro ::
    echo $tabjscript;
    //BOF :: Tabbed Products Pro ::
    ?>

  3. #3
    Join Date
    Apr 2010
    Posts
    900
    Plugin Contributions
    0

    Default Re: How to control the Quantity Discount Table?

    stylesheet.css:
    Code:
    body{margin: 0;font-family: verdana, arial, helvetica, sans-serif;font-size: 68%;color: #444;background: #1f4f7d  url(../images/bk.jpg) repeat-x;}
    
    /*bof basic elements*/
    a img {border: none;}
    a:link, #navEZPagesTOC ul li a {color: #444444;text-decoration: none;}
    a:visited {color: #444444;text-decoration: none;}
    a:hover, #navEZPagesTOC ul li a:hover, #navMain ul li a:hover, #navSupp ul li a:hover, #navCatTabs ul li a:hover {color: #184b7a;}
    a:active {color: #444444;}
    h1 {font-size: 1.4em;}
    h2 {font-size: 1.3em;}
    h3 {font-size: 1.2em;}
    h4, h5, h6, LABEL, h4.optionName, LEGEND, ADDRESS, .sideBoxContent, .larger{font-size: 0.9em;}
    .biggerText {font-size: 1.2em;}
    .clearBoth {clear: both;}
    HR {height: 1px;margin-top: 0.5em;border: none;border-bottom: 1px solid #9a9a9a;}
    h1, h2, h3 {text-align: left;}, h4, h5, h6 {margin: 0.3em 3px;}
    
    
    /*bof form elements*/
    CODE {font-family: arial, verdana, helvetica, sans-serif;font-size: 0.9em;}
    FORM, SELECT, INPUT {display: inline;font-size: 1em;margin: 0.1em;}
    TEXTAREA {margin: auto;display: block;width: 95%;}
    input:focus, select:focus, textarea:focus {background: #f7f7f7;}
    FIELDSET {padding: 0.5em;margin: 0.5em 0em;border: 1px solid #ccc;}
    LEGEND {font-weight: bold;padding: 0.3em;}
    LABEL, h4.optionName {line-height: 1.5em;padding: 0.2em;}
    LABEL.checkboxLabel, LABEL.radioButtonLabel {margin: 0.5em 0.3em;}
    LABEL.inputLabel {width: 11em;float: left;}
    LABEL.inputLabelPayment {width: 15em;float: left;}
    LABEL.selectLabel, LABEL.switchedLabel, LABEL.uploadsLabel  {width: 12em;float: left;}
    P, ADDRESS {padding: 0.5em;}
    ADDRESS {font-style: normal;}
    
    /*bof warnings, errors, messages*/
    .messageStackWarning, .messageStackError, .messageStackSuccess, .messageStackCaution {line-height: 1.8em;padding: 0.2em;border: 1px solid #000;}
    .messageStackWarning, .messageStackError {background-color: #ff0000;color: #fff;}
    .messageStackSuccess {background-color: #99ff99;color: #000;}
    .messageStackCaution {background-color: #ffff66;color: #000;}
    
    /*bof wrappers - page or section containers*/
    #mainWrapper {background:transparent;text-align: left;width: 980px;vertical-align: top;}
    #headerWrapper, #contentMainWrapper, #logoWrapper, #cartBoxListWrapper, #ezPageBoxList, #cartBoxListWrapper ul, #ezPageBoxList ul, #mainWrapper, #popupAdditionalImage, #popupImage {margin: 0em;padding: 0em;}
    #mainWrapper {margin: auto;} 
    #navColumnOneWrapper, #navColumnTwoWrapper {background:#fff;-moz-border-radius: 10px;-webkit-border-radius: 10px;border-radius: 10px;} 
    #logo, .centerBoxContents, .specialsListBoxContents, .categoryListBoxContents, .centerBoxContentsAlsoPurch, .attribImg {float: left;}
    #tagline {display:none;}
    #logo {padding-top:0px;padding-left:0px;margin-top:-10px;margin-left:5px;}
    #sendSpendWrapper {border: 1px solid #cacaca;float: right;margin: 0em 0em 1em 1em;}
    .floatingBox, #accountLinksWrapper, #sendSpendWrapper, #checkoutShipto, #checkoutBillto, #navEZPagesTOCWrapper {margin: 0;width: 47%;}
    .wrapperAttribsOptions {margin: 0.3em 0em;}
    #contentMainWrapper{padding-bottom:0px;padding-top:0px;background:#fff;position:relative;top:-70px;}
    #content-container{position:relative;top:-25px;}
    
    /*bof navigation*/
    .navNextPrevCounter {margin: 0em;font-size: 0.9em;}
    .navNextPrevList {display: inline;white-space: nowrap;margin: 0;padding:  0.5em 0em;list-style-type: none;}
    #navCategoryIcon, .buttonRow, #indexProductListCatDescription {margin: 0.5em;}
    #navBreadCrumb {background:transparent;}
    
    /*bof header*/
    #headerWrapper{background:#fff;margin-top:15px;-moz-border-radius: 5px;-webkit-border-radius: 5px;border-radius: 5px;}
    #navMainWrapper {margin: 0em;background:transparent;font-weight: normal;color: #230f0f;height: 1%;width: 100%;margin-top:25px;}
    #navMain ul  {margin: 0;padding:  0.5em 0em;list-style-type: none;text-align: center;line-height: 1.5em;float:right;margin-top:40px;background:transparent;padding:15px;margin-top:3px;-moz-border-radius: 5px;-webkit-border-radius: 5px;border-radius: 5px;}
    #navMain ul li {display: inline;position:relative;top:-68px;}
    #navMain ul li a {text-decoration: none;padding: 0em 0.5em;margin: 0;color: #444;white-space: nowrap;}
    #navMain ul li a:hover{color:#184b7a;text-decoration:underline;}
    #top-menu-wrapper {margin: 0em;background-color: #73cee1;font-weight: normal;color: #fff;height: 1%;width: 100%;}
    #top-menu ul  {margin: 0;padding:  0.5em 0em;list-style-type: none;text-align: center;line-height: 1.5em;}
    #top-menu ul li {display: inline;}
    #top-menu ul li a {text-decoration: none;padding: 0em 0.5em;margin: 0;color: #444444;white-space: nowrap;}
    #header-lan-curr {margin:0em;float:right;color:#444;position:relative;top:75px;}
    #header-lan-curr img{vertical-align:middle;} 
    #currency_header {float:right;margin-right:35px;margin-top:3px;}
    #lang_header {float:right;margin-right:0px;margin-top:5px;color:#444;}
    .header-checkout {color:#184b7a;font-weight:bold;text-decoration:underline;}
    .header-checkout:hover {color:#444;}
    #navCatTabsWrapper {margin: 0em;background-color: #444443;font-weight: bold;color: #fffffd;height: 1%;width: 100%;}
    #navCatTabs ul  {margin: 0;padding:  0.5em 0em;list-style-type: none;text-align: center;line-height: 1.5em;}
    #navCatTabs ul li {display: inline;}
    #navCatTabs ul li a {text-decoration: none;padding: 0em 0.5em;margin: 0;color: #fffffc;white-space: nowrap;}
    #navEZPagesTop {background-color: #444443;}
    #navBreadCrumb{font-size: 0.95em;font-weight: bold;margin: 0em;padding: 0.5em;}
    #navEZPagesTop {font-size: 0.95em;font-weight: bold;margin: 0em;padding: 0.5em;color:#fffffc;}
    #navEZPagesTop a{color:#fffffc;}
    #navEZPagesTop a:hover {color:#67cadf;}
    #navBreadCrumb {margin-top:0px;margin-left:10px;}
    #header-right{width:500px;float:right;margin-top:30px;}
    #header-promo{color:#d4d2d1;font-size:1.65em;line-height:25px;text-align:center;float:right;margin-top:-80px;display:none;}
    .promo-big{color:#80ae18;font-size:150%;}
    .promo-green{color:#80ae18;}
    #navMainSearch {float:right;position:relative;top:-25px;right:10px;z-index:9000;}
    #navMainSearch input[type=image] {vertical-align:middle;margin-left:-9px;margin-top:-1px;position:relative;z-index:9001;}
    .search-header-box {border:1px solid #230f0f;width:200px;height:21px;padding-left:10px;-moz-border-radius: 5px;opacity:0.6;filter: alpha(opacity=60);}
    .home-icon, .login-icon, .cart-icon, .checkout-icon, .logoff-icon, .account-icon{vertical-align:middle;margin-right:5px;}
    .h-sm{height:15px;width:15px;margin-right:10px;margin-bottom:5px;vertical-align:middle;}
    
    /*bof ezpages*/
    #navEZPagesTOCWrapper {font-weight: bold;float: right;height: 1%;border: 1px solid #000;}
    #navEZPagesTOC ul {margin: 0;padding:  0.5em 0em;list-style-type: none;	line-height: 1.5em;}
    #navEZPagesTOC ul li {white-space: nowrap;}
    #navEZPagesTOC ul li a {padding: 0em 0.5em;margin: 0;}
    
    /*bof the main content classes*/
    #contentColumnMain, #navColumnOne, #navColumnTwo, .centerBoxContents, .specialsListBoxContents, .categoryListBoxContents, .additionalImages, .centerBoxContentsSpecials, .centerBoxContentsAlsoPurch, .centerBoxContentsFeatured, .centerBoxContentsNew, .alert {vertical-align: top;}
    #productDescription, .shippingEstimatorWrapper {padding: 0.5em;}
    .alert {color: #ff0001;margin-left: 0.5em;}
    .important {font-weight: bold;}
    .gvBal {float: right;}
    #bannerOne, #bannerTwo,  #bannerThree,  #bannerFour,  #bannerFive,  #bannerSix {padding: 0.8em;}
    .centerColumn{padding: 0.8em;}
    .smallText, #siteinfoLegal, #siteinfoCredits, #siteinfoStatus, #siteinfoIP {font-size: 0.9em;}
    
    /*bof shopping cart display*/
    #cartContentsDisplay {border-left:1px solid #dfdfe7;border-right:1px solid #dfdfe7;border-top:1px solid #dfdfe7;}
    #cartContentsDisplay td{border-bottom:1px dashed #ccc;padding-top:15px;}
    .cartQuantity input{margin-left:15px;}
    .rowOdd {background-color: #fff;height: 1.5em;vertical-align: top;}
    .rowEven {background-color: #fff;height: 1.5em;vertical-align: top;}
    .tableHeading TH {background: #286cab;height:30px;border-bottom: 1px solid #ccc;color:#fff;}
    .tableHeading, #cartSubTotal {background-color: #286cab;color:#fff;}
    #cartSubTotal {font-weight: bold;text-align: right;line-height: 2.2em;padding-right: 2.5em;}
    .tableRow, .tableHeading, #cartSubTotal {height: 2.2em;}
    .cartProductDisplay, .cartUnitDisplay, .cartTotalDisplay, .cartRemoveItemDisplay, .cartQuantityUpdate, .cartQuantity, #cartInstructionsDisplay, .cartTotalsDisplay   {padding: 0.5em 0em;}
    .cartUnitDisplay, .cartTotalDisplay {text-align: right;padding-right: 0.2em;}
    #scUpdateQuantity {}
    .cartQuantity {width: 4.7em;}
    .cartNewItem {color: #444444;position: relative;  /*do not remove-fixes stupid IEbug*/}
    .cartOldItem {color: #444444;position: relative;   /*do not remove-fixes stupid IEbug*/}
    .cartBoxTotal {text-align: right;font-weight: bold;}
    .cartRemoveItemDisplay {width: 3.5em;}
    .cartAttribsList {margin-left: 1em;}
    #mediaManager {width: 50%;margin: 0.2em;padding: 0.5em;}
    .mediaTitle {float: left;}
    .mediaTypeLink {float: right;}
    .normalprice, .productSpecialPriceSale {text-decoration: line-through;}
    .productSpecialPrice, .productSalePrice, .productSpecialPriceSale, .productPriceDiscount {color: #ff0001;}
    .orderHistList {margin: 1em;padding: 0.2em 0em;} 
    #cartBoxListWrapper ul, #ezPageBoxList ul {list-style-type: none;}
    #cartBoxListWrapper li, #ezPageBoxList li, .cartBoxTotal {margin: 0;padding: 0.2em 0em;} 
    #cartBoxEmpty, #cartBoxVoucherBalance {font-weight: bold;}
    .totalBox {width: 5.5em;text-align: right;padding: 0.2em;}
    .lineTitle, .amount {text-align: right;padding: 0.2em;}
    .amount {width: 5.5em;}
    #infoShoppingCart{background:none;}
    
    /*bof image display*/
    #productMainImage, #reviewsInfoDefaultProductImage, #productReviewsDefaultProductImage, #reviewWriteMainImage {margin: 0em 1em 1em 0em;float:right}
    #cartImage {margin: 0.5em 1em;}
    
    /*bof attributes*/
    .attribImg {width: 20%;margin: 0.3em 0em;}
    
    /*bof list box contents*/
    .centerBoxContents, .specialsListBoxContents, .categoryListBoxContents, .additionalImages, .centerBoxContentsSpecials, .centerBoxContentsAlsoPurch, .centerBoxContentsFeatured, .centerBoxContentsNew {margin: .25em 0em;}
    
    /*bof sideboxes*/
    #navColumnOne, #navColumnTwo{background:transparent;padding-top:10px;}
    
    h3.leftBoxHeading a, h3.rightBoxHeading a{color: #fff;font-size:14px;}
    h3.leftBoxHeading  {margin: 0em;padding: 0.5em 0.2em;color:#fff;font-weight:normal;font-size:14px;margin-left:5px;background: url(../images/sidebox-head-left.png) no-repeat;width:201px;height:50px;margin-left:-21px;margin-bottom:-31px;}
    h3.rightBoxHeading {margin: 0em;padding: 0.5em 0.2em;color:#fff;font-weight:normal;font-size:14px;margin-left:5px;background: url(../images/sidebox-head-right.png) no-repeat;width:201px;height:50px;margin-right:-21px;margin-bottom:-31px;}
    .centerBoxHeading{padding: 0.5em 0.2em;color:#444;font-weight:normal;font-size:14px;padding-bottom:10px;text-align:left;padding-left:25px;}
    .leftBoxContainer, .rightBoxContainer {margin-bottom:20px;}
    .sideBoxContent {padding: 0.4em;padding-bottom:10px;margin-left:5px;margin-top:0px;padding-top:10px;border-bottom:0px dashed #ccc;border-right:0px dashed #ccc;border-left:0px dashed #ccc;}
    h3.leftBoxHeading a:hover, h3.rightBoxHeading a:hover {color: #3a89d6;text-decoration: none;} 
    #catBoxDivider {display:none;}
    #whatsnew, #featured, #specials {color:#444;}
    #whatsnew a, #featured a, #specials a{color:#fff;} 
    #specialsHeading a, #whatsnewHeading a, #featuredHeading a {}
    #specialsHeading a:hover, #whatsnewHeading a:hover, #featuredHeading a:hover {color:#184b7a;}
    #shoppingcartHeading {font-size:1.1em;}
    .centeredContent, TH, #cartEmptyText, #cartBoxGVButton, #cartBoxEmpty, #cartBoxVoucherBalance, #navCatTabsWrapper, #navEZPageNextPrev, #bannerOne, #bannerTwo,  #bannerThree,  #bannerFour,  #bannerFive,  #bannerSix, #siteinfoCredits, #siteinfoStatus, #siteinfoIP, .center, .cartRemoveItemDisplay, .cartQuantityUpdate, .cartQuantity, .cartTotalsDisplay, #cartBoxGVBalance, .leftBoxHeading, .rightBoxHeading, .productListing-data, .accountQuantityDisplay, .ratingRow, LABEL#textAreaReviews, #productMainImage, #reviewsInfoDefaultProductImage, #productReviewsDefaultProductImage, #reviewWriteMainImage, .centerBoxContents, .specialsListBoxContents, .categoryListBoxContents, .additionalImages, .centerBoxContentsSpecials, .centerBoxContentsAlsoPurch, .centerBoxContentsFeatured, .centerBoxContentsNew, .gvBal, .attribImg {text-align: center;}
    #bestsellers .wrapper {margin: 0em 0em 0em 1.5em;}
    #bestsellers ol {padding: 0;margin-left: 1.1em;}
    #bestsellers li {padding: 0;margin: 0.3em 0em 0.3em 0em;}
    #upProductsHeading {text-align: left;}
    #upDateHeading {text-align: right;}
    
    
    /*bof misc*/
    .back {float: left;}
    .forward, #shoppingCartDefault #PPECbutton {float: right;}
    .bold {font-weight: bold;}
    .hiddenField {display: none;}
    .visibleField {display: inline;}
    #myAccountGen li, #myAccountNotify li {margin: 0;} 
    .accountTotalDisplay, .accountTaxDisplay {width: 20%;text-align: right;}
    .accountQuantityDisplay {width: 10%;vertical-align: top;}
    TR.tableHeading {background-color: #eaeaea;height: 2em;}
    #siteMapList {width: 90%;float: right;}
    .ratingRow {margin: 1em 0em 1.5em 0em;}
    LABEL#textAreaReviews {font-weight: normal;margin: 1em 0em;}
    #popupShippingEstimator, #popupSearchHelp, #popupAdditionalImage, #popupImage, #popupCVVHelp, #popupCouponHelp, #popupAtrribsQuantityPricesHelp, #infoShoppingCart {background-color: #fff;}
    .information {padding: 10px 3px; line-height: 150%;}
    #shoppingcartBody #shippingEstimatorContent {clear: both;}
    .seDisplayedAddressLabel {background-color:#85C285;text-align: center;}
    .seDisplayedAddressInfo {text-transform: uppercase;text-align: center;font-weight: bold;}
    #seShipTo {padding: 0.2em;}
    
    /*bof center boxes*/
    .product_title {font-size:110%;font-weight:bold;}
    .product_title a{color:#444444;}
    .product_title a:hover{color:#3a89d6;} 
    .product_detail {margin-top:10px;}
    .price {font-size:110%;font-weight:bold;color:#444444;}
    .normalprice {font-size:90%;}
    .productSpecialPrice {font-size:90%;}
    
    /*bof product listing*/
    .listingDescription {text-align:left;}
    .productListing-even {border:1px dashed #ccc;}
    .productListing-rowheading {background:#286cab;height:30px;;color:#fff;text-transform:uppercase;}
    .productListing-rowheading a{color:#fffffe;}
    .productListing-rowheading a:hover{color:#3a89d6;}
    #productsListingTopNumber {margin-top:15px;margin-bottom:15px;}
    #productsListingBottomNumber {margin-top:15px;margin-bottom:15px;}
    #productListHeading {margin-bottom:15px;color:#444444;font-weight:bold;padding-bottom:1px;}
    .tabTable {border-left:1px solid #dfdfe7;border-right:1px solid #dfdfe7;border-top:1px solid #dfdfe7;}
    .productListing-data {border-bottom:1px dashed #ccc;}
    .listingProductImage{margin-top:15px;margin-bottom:15px;}
    
    /*bof product info*/
    #cartAdd {text-align: center;margin: 0em;border: 0px solid #000;padding: 0em;}
    #product-divider {border-bottom:1px dashed #ccc;margin-top:20px;}
    .navNextPrevWrapper {text-align:center;}
    .navNextPrevCounter {text-align:center;}
    #productDescription {color:#888787;}
    #productName {color:#444;font-weight:normal;font-size:1.5em;}
    #productDetailsList {color:#888787;margin-top:10px;margin-bottom:10px;float:left;}
    #productAttributes {}
    #attribsOptionsText {font-weight:normal;color:#888787;}
    .optionName {color:#444444;margin-top:0px;} 
    #alsoPurchased {margin-top:20px;}
    #productPrices{text-align:center;}
    #p-left{float:left;}
    #p-right{float:right;}
    #p-mikey{}
    #cart{border:1px solid #e1e1e9;padding:0px 10px 10px 10px;background:#f5f5f7;-moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px;}
    #mikeycart{width: 70%;border:1px solid #e1e1e9;padding:0px 10px 10px 10px;background:#f5f5f7;-moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px;}
    #productQuantityDiscounts{
    	overflow:hidden;
    	float:left;
    	width: 100%
    }
    #productQuantityDiscounts td{
    	border:1px solid #eceaea;
    	text-align:center;
    }
    #productQuantityDiscounts tr:first-child{
    	font-weight:bold;
    }
    #mikeytable{
    	overflow:hidden;
    	float:left;
    	width: 100%
    }
    
    
    
    /*bof monthly boxes*/
    .box_image {margin-top:15px;margin-bottom:15px;}
    
    /*bof don't display header ezpages or category tabs*/
    #navCatTabs, #navEZPagesTop{display:none;}
    
    /*bof cross browser*/
    .ie8 #navMainSearch input[type=image]{margin-top:5px;}
    .ie8 .menuTitle{color:#fff;}
    .ie8 #footer {background: #3a88d5 url(../images/footer-bk.jpg) repeat-x;width:100%; }
    .ie8 #nav-supp-wrapper{background:url(../images/menu-bk.jpg) no-repeat;}
    .ie9 #mega-wrapper{margin-top:30px;}
    .ie9 #navMainSearch{margin-top:10px;}
    .ie7 #mega-wrapper .mega-menu{margin-top:25px;}
    .ie7 #navMainSearch{margin-top:-10px;}
    .ie7 #navMainSearch input[type=image]{margin-top:-10px;position:relative;right:6px;}
    .ie7 h3.rightBoxHeading{position:relative;z-index:18000;margin-right:-27px;}
    .ie7 h3.leftBoxHeading{position:relative;z-index:18000;margin-right:-27px;}
    .ie7 .menuTitle{color:#fff;}
    .ie7 #footer {background: #3a88d5 url(../images/footer-bk.jpg) repeat-x;width:100%; }
    .ie7 #nav-supp-wrapper{background:url(../images/menu-bk.jpg) no-repeat;}
    .chrome #mega-wrapper .mega-menu{position:relative;top:-2px;}
    .chrome #navMainSearch{margin-top:9px;}
    .chrome #navMainSearch input[type=image]{margin-right:6px;margin-top:-3px;}
    .safari #mega-wrapper .mega-menu{margin-top:30px;}
    .safari #navMainSearch{margin-top:9px;}
    .safari #navMainSearch input[type=image]{margin-right:6px;margin-top:-3px;}
    
    /*MIKEY D*/
    #attribsOptionsText {display:none;}

  4. #4
    Join Date
    Apr 2010
    Posts
    900
    Plugin Contributions
    0

    Default Re: How to control the Quantity Discount Table?

    tpl_modules_products_quantity_discounts.php:
    Code:
    <?php
    /**
     * Module Template
     *
     * @package templateSystem
     * @copyright Copyright 2003-2005 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: tpl_modules_products_quantity_discounts.php 3291 2006-03-28 04:03:38Z ajeh $
     */
    
    ?>
    <div id="productQuantityDiscounts">
    <?php
      if ($zc_hidden_discounts_on) {
    ?>
      <table border="1" cellspacing="2" cellpadding="2">
        <tr>
          <td colspan="1" align="center">
          <?php echo TEXT_HEADER_DISCOUNTS_OFF; ?>
          </td>
        </tr>
        <tr>
          <td colspan="1" align="center">
          <?php echo $zc_hidden_discounts_text; ?>
          </td>
        </tr>
      </table>
    <?php } else { ?>
      <table border="1" cellspacing="2" cellpadding="2">
        <tr>
          <td colspan="<?php echo $columnCount+1; ?>" align="center">
    <?php
      switch ($products_discount_type) {
        case '1':
          echo TEXT_HEADER_DISCOUNT_PRICES_PERCENTAGE;
          break;
        case '2':
          echo TEXT_HEADER_DISCOUNT_PRICES_ACTUAL_PRICE;
          break;
        case '3':
          echo TEXT_HEADER_DISCOUNT_PRICES_AMOUNT_OFF;
          break;
      }
    ?>
          </td>
        </tr>
    
        <tr>
          <td align="center"><?php echo $show_qty . '<br />' . $currencies->display_price($show_price, zen_get_tax_rate($products_tax_class_id)); ?></td>
    
    <?php
      foreach($quantityDiscounts as $key=>$quantityDiscount) {
    ?>
    <td align="center"><?php echo $quantityDiscount['show_qty'] . '<br />' . $currencies->display_price($quantityDiscount['discounted_price'], zen_get_tax_rate($products_tax_class_id)); ?></td>
    <?php
        $disc_cnt++;
        if ($discount_col_cnt == $disc_cnt && !($key == sizeof($quantityDiscount))) {
          $disc_cnt=0;
    ?>
      </tr><tr>
    <?php
        }
      }
    ?>
    <?php
      if ($disc_cnt < $columnCount) {
    ?>
        <td align="center" colspan="<?php echo ($columnCount+1 - $disc_cnt)+1; ?>"> &nbsp; </td>
    <?php } ?>
        </tr>
    <?php
      if (zen_has_product_attributes($products_id_current)) {
    ?>
        <tr>
          <td colspan="<?php echo $columnCount+1; ?>" align="center">
            <?php echo TEXT_FOOTER_DISCOUNT_QUANTITIES; ?>
          </td>
        </tr>
    <?php } ?>
      </table>
    <?php } // hide discounts ?>
    </div>

  5. #5
    Join Date
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: How to control the Quantity Discount Table?

    Quote Originally Posted by Feznizzle View Post

    Problem #1
    No matter what I do, I do NOT seem to be able to control the QDT table size (width: 100% or width: 300px)!
    adding this to your stylesheet will give your table the width of it's containing div

    #productQuantityDiscounts TABLE {
    width:100%;
    }

    Quote Originally Posted by Feznizzle View Post
    Problem #2 (super frustrating)
    The code that generates this table automatically inserts a new row (<tr>) as soon as 6 price breaks are found. Problem is that some of my manufacturers have as many as 7 breaks. Which ends up looking very awkward:
    http://2staging.apswittcosales.com/M..._2_x_18-1_2_IN
    admin > configuration > Product Discount Quantities - Display how many per row?

    Quote Originally Posted by Feznizzle View Post
    Just as annoying, if I have 6 price breaks, the code generates a new row (<tr>) and puts nothing in it:
    http://2staging.apswittcosales.com/M..._4_7_INCH_REEL
    That table row is intentional and displays text like in the page example here:
    http://2staging.apswittcosales.com/C...3_4_x_3-1_2_IN

    Because that product has attributed


    Quote Originally Posted by Feznizzle View Post
    I want to tell it *NOT* to generate a new row until 10 discounts (basically, never).
    admin > configuration > Product Discount Quantities - Display how many per row?

    Quote Originally Posted by Feznizzle View Post
    Problem #3 (less important, but I'd still really like to solve)
    I would *LOVE* to simplify the chart (using THIS PAGE as my example)...
    From:
    1-49 | 50-99 | 100-249 | 250-499 | 500-999 | 1,000+

    To:
    1-49 | 50+ | 100+ | 250+ | 500+ | 1,000+
    Would involve custom coding but anything can be done!

  6. #6
    Join Date
    Apr 2010
    Posts
    900
    Plugin Contributions
    0

    Default Re: How to control the Quantity Discount Table?

    Thank you so much! Worked out beautifully!

    In case anybody else stumbles in looking for the same answer, this might be helpful:
    admin > configuration > Layout Settings > Product Discount Quantities - Display how many per row?

    I'd really love to figure out the "custom coding"! I may take a stab at it. If I don't post a 'how to' it's because I never figured it out.

  7. #7
    Join Date
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: How to control the Quantity Discount Table?

    Quote Originally Posted by Feznizzle View Post
    Thank you so much! Worked out beautifully!

    In case anybody else stumbles in looking for the same answer, this might be helpful:
    admin > configuration > Layout Settings > Product Discount Quantities - Display how many per row?

    I'd really love to figure out the "custom coding"! I may take a stab at it. If I don't post a 'how to' it's because I never figured it out.
    glad I could help!

    and yes that would be the correct path:
    admin > configuration > Layout Settings > Product Discount Quantities - Display how many per row?


  8. #8
    Join Date
    Apr 2010
    Posts
    900
    Plugin Contributions
    0

    Default Re: How to control the Quantity Discount Table?

    Appears the correct code to edit lives here:
    products_quantity_discounts.php

    I have managed to replace the dashes with pluses (- becomes +). And I think I have found the line that needs to be fixed:
    $quantityDiscounts[$columnCount]['show_qty'] .= '+' . number_format($products_discounts_query->fields['discount_qty']-1);

    When I try to remove the second part like this:
    $quantityDiscounts[$columnCount]['show_qty'] .= '+');

    Everything just goes screwy. I wonder how to change???

  9. #9
    Join Date
    Apr 2010
    Posts
    900
    Plugin Contributions
    0

    Default Re: How to control the Quantity Discount Table?

    Ok, kids! Here is the solution. Inside of this file (move to override folder): products_quantity_discounts.php

    Change this line:
    $quantityDiscounts[$columnCount]['show_qty'] .= '-' . number_format($products_discounts_query->fields['discount_qty']-1);

    To this:
    $quantityDiscounts[$columnCount]['show_qty'] .= '+';

    Wham bam thank you, ma'am.

    Can somebody click on one of my links and check to see if I created any errors? If for no other reason than to just make sure I'm not telling folks to do something bad?

    Thanks,
    Mike
    Last edited by Feznizzle; 17 Jul 2013 at 01:01 AM. Reason: oops

 

 

Similar Threads

  1. v139h Can I show quantity discount table on the product-listing screen?
    By christospur in forum General Questions
    Replies: 4
    Last Post: 24 Feb 2015, 05:22 PM
  2. v139f Edit the look of the quantity discount table on product page?
    By amylynpace in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 13 Nov 2012, 07:31 PM
  3. Quantity Discount Table
    By kraperw in forum General Questions
    Replies: 1
    Last Post: 8 Dec 2011, 08:25 PM
  4. Quantity Discount Table
    By CharInLasVegas in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 25 Nov 2009, 04:49 PM
  5. Where is the file for editing the table displayed by Quantity Discount...
    By flipjargendy in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 28 Aug 2007, 02:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg