Results 1 to 10 of 10
  1. #1
    Join Date
    Nov 2009
    Posts
    42
    Plugin Contributions
    0

    help question Quantity Discount box only display percentage

    Hi.

    I would like to modify the Quantity Discount display box at product view.
    E.g. using Quantity Discount along with product priced by attribute, makes the display somewhat irrelevant. (Calculating only the cheapest attribute)
    Also, A calculated discount of a low cost item, doesn't look much...

    Instead, I would like the Discount box only show the discount percentage! Not any calculated price at all!
    E.g. By 10-20 pcs. and get 10% off! , By 20-40 pcs. and get 20% off! , By more then 50 pcs. and get 30% off!...
    Also this would make the first column with 0% discount unnecessary to display at all...

    Could this be done?

  2. #2
    Join Date
    Nov 2009
    Posts
    42
    Plugin Contributions
    0

    Default Re: Quantity Discount box only display percentage

    Sorry... Missed a little word, and got a misleading headline...
    Anyway.. BUMP!

  3. #3
    Join Date
    Nov 2009
    Posts
    42
    Plugin Contributions
    0

    Default Re: Quantity Discount box only display percentage

    I'll be damned... 67 views and still no comment...

    Well.. I have seen that this type of question has come up several times over the years, but no one I have seen either had any luck with answers...
    Doesn't seem to be that impossible to achieve does it?

    Maybe admin kindly would rephrase the header?...

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Quantity Discount box only display percentage

    That is managed by the files:
    /includes/modules/products_quantity_discounts.php
    /includes/templates/template_default/templates/tpl_modules_products_quantity_discounts.php

    Using your templates and overrides you could customize those files to look the way you would like them to be on the display ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Nov 2009
    Posts
    42
    Plugin Contributions
    0

    Default Re: Quantity Discount box only display percentage

    Thank you Ajeh!

    I've been fiddling around with them files quite a bit now, but I just don't possess the knowledge to alter that php...

    Got it to display the discount percent with 4 decimals in a way... -And I basically hasn't got a clue what I'm doing...

    If you could find the time to help me out I would be soo grateful!
    I'll even by you a ice-cream when you visit Norway!

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Quantity Discount box only display percentage

    Copy the file:
    /includes/modules/products_quantity_discounts.php

    to your templates and overrides directory:
    /includes/modules/your_template_dir/products_quantity_discounts.php

    and change the code around line 98 to:
    Code:
        // percentage discount
        case '1':
          if ($products_discount_type_from == '0') {
    //        $quantityDiscounts[$columnCount]['discounted_price'] = $display_price - ($display_price * ($products_discounts_query->fields['discount_price']/100));
            $quantityDiscounts[$columnCount]['discounted_price'] = ($products_discounts_query->fields['discount_price']/100);
          } else {
            if (!$display_specials_price) {
    //          $quantityDiscounts[$columnCount]['discounted_price'] = $display_price - ($display_price * ($products_discounts_query->fields['discount_price']/100));
              $quantityDiscounts[$columnCount]['discounted_price'] = ($products_discounts_query->fields['discount_price']/100);
            } else {
    //          $quantityDiscounts[$columnCount]['discounted_price'] = $display_specials_price - ($display_specials_price * ($products_discounts_query->fields['discount_price']/100));
              $quantityDiscounts[$columnCount]['discounted_price'] = ($products_discounts_query->fields['discount_price']/100);
            }
          }
        break;
    then copy the file:
    /includes/templates/template_default/templates/tpl_modules_products_quantity_discounts.php

    to your templates and overrides directory:
    /includes/templates/your_template_dir/templates/tpl_modules_products_quantity_discounts.php

    and around line 55 change the code to:
    Code:
    <!-- <td align="center"><?php echo $quantityDiscount['show_qty'] . '<br />' . $currencies->display_price($quantityDiscount['discounted_price'], zen_get_tax_rate($products_tax_class_id)); ?></td> -->
    <td align="center"><?php echo $quantityDiscount['show_qty'] . '<br />' . ($quantityDiscount['discounted_price'] * 100) . '%'; ?></td>
    See if that is what you are looking to do ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  7. #7
    Join Date
    Nov 2009
    Posts
    42
    Plugin Contributions
    0

    Default Re: Quantity Discount box only display percentage

    Very nice Ajeh! You are the best!

    Could you please also show me how to get rid of that first td with the "base price"?
    And is it possible to insert extra text in the table?

    Thank you so much!

  8. #8
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Quantity Discount box only display percentage

    About line 50, change the code to:
    Code:
    <!--      <td align="center"><?php echo $show_qty . '<br />' . $currencies->display_price($show_price, zen_get_tax_rate($products_tax_class_id)); ?></td> -->
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  9. #9
    Join Date
    Nov 2009
    Posts
    42
    Plugin Contributions
    0

    Default Re: Edit Quantity Discount box to make it only display percentage drawn

    Thanks again Ajeh! You're my hero!

    About the text, I did put it next to the <br/> tag, and got what I wanted. Hope that wont mess anything up!...
    Code:
    <td align="center"><?php echo $quantityDiscount['show_qty'] . '&nbsp;st.<br /> -' . ($quantityDiscount['discounted_price'] * 100) . '%'; ?></td><?php
    That's a double vanilla with chocolate and a strawberry on top!

  10. #10
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Quantity Discount box only display percentage

    Thanks for the update that this worked for you ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

 

 

Similar Threads

  1. Percentage Discount Not showing Text or Percentage off
    By milobloom in forum General Questions
    Replies: 13
    Last Post: 28 Jun 2010, 07:06 AM
  2. Quantity Discount in Percentage
    By lomo in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 8 May 2009, 09:38 AM
  3. Quantity Discount Display
    By leew04 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 3 Mar 2008, 01:39 AM
  4. How to display quantity discount box in product list?
    By tintin123 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 7 Oct 2007, 07:59 AM
  5. Quantity Discount Display Issue
    By quixotica in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 5
    Last Post: 21 Mar 2007, 05:35 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR