Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2006
    Posts
    6
    Plugin Contributions
    0

    quantity discounts for wholesale customers

    I am so close to completing the site I installed Zen Cart on -- the customization is going well, features are great etc....

    but... I need some serious help.

    For some of the products there are "Quantity Discounts" and it works great. Problem is, I am using the Dual Pricing module -and I need the quantity discounts to apply to wholesale customers only.

    Here's the module I'm using - Dual Pricing - Wholesale Pricing - http://www.zen-cart.com/index.php?ma...roducts_id=166

    You can see the product here - obviously the quantity discount is currently public (not wholesale) http://66.246.172.217/shop/index.php...products_id=30

    If anyone out there can help me, it would be greatly appreciated! I really want to avoid completely hacking the site.

    Thanks!!!

    EDITED: Never, ever post the zen_id or zenAdminID (session id) in a forum, email, newsgroup, newsletter, advertisement, etc. etc. etc. or you will be doomed ...
    Last edited by Ajeh; 16 Sep 2006 at 06:17 PM.

  2. #2
    Join Date
    Sep 2006
    Posts
    6
    Plugin Contributions
    0

    Default Re: quantity discounts for wholesale customers

    resolved!

    4 episodes of project runway later... i figured it out... just a few lines, which i knew it would be but... where? was the question.

    it's not a very flexible fix - it makes it so that all quantity discounts are wholesale only as opposed to the ideal of having it be an admin setting.

    restrictions -
    -must be used with the module for Wholesale/Dual Pricing (link in above post)
    -no "discount quantity" pricing will be allowed for retail customers. never.


    file: includes/functions/functions_prices.php

    around line 1473
    function zen_get_products_discount_price_qty($product_id, $check_qty, $check_amount=0)

    under the switch ($products_query->fields['products_discount_type'])
    in case '2': (which is the quantity discount option)

    at the very end add in:
    Code:
    $customers_id = $_SESSION['customer_id'];
    $customer_check = $db->Execute("select * from " . TABLE_CUSTOMERS . " where customers_id = '$customers_id'");
    if ($customer_check->fields['customers_whole'] != "1")
    	$discounted_price = $display_price;
    so the entire case '2' looks like this:

    Code:
     // actual price
            case '2':
              if ($products_query->fields['products_discount_type_from'] == '0') {
                $discounted_price = $products_discounts_query->fields['discount_price'];
              } else {
                $discounted_price = $products_discounts_query->fields['discount_price'];
              }
    		  $customers_id = $_SESSION['customer_id'];
    		  $customer_check = $db->Execute("select * from " . TABLE_CUSTOMERS . " where customers_id = '$customers_id'");
    		  if ($customer_check->fields['customers_whole'] != "1")
    		  		$discounted_price = $display_price;
              break;
            // amount offprice
            case '3': ....

  3. #3
    Join Date
    Sep 2006
    Posts
    6
    Plugin Contributions
    0

    Default Re: quantity discounts for wholesale customers

    oh and I forgot, to make it so the table of discount pricing doesnt show up on the product info page, you have to add in a check to see if the cutomer is wholesale -- $cusomter_whole =1

    the code may be a bit different depending on the template you are using but you are looking for the test for $products_discount_type != 0

    file: tpl_product_info_display.php
    for me it's located in: includes/templates/templates_default/templates/

    Code:
    <!--bof Quantity Discounts table -->
    <?php
      if (($products_discount_type != 0 ) && ($customer_check->fields['customers_whole'] == "1")) { ?>
    <?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
      }
    ?>

  4. #4
    Join Date
    Feb 2006
    Posts
    4
    Plugin Contributions
    0

    Default Re: quantity discounts for wholesale customers

    Actually, I need to do the oposit. I have volume discounts for the retail customers but don't need the volume discounts to show in the whole sale section. I tried the changing the code of
    if (($products_discount_type != 0 ) && ($customer_check->fields['customers_whole'] == "1")) { ?>
    to
    if (($products_discount_type != 0 ) && ($customer_check->fields['customers_whole'] == "0")) { ?>
    It worked as in the volume discounts are not showing up for the wholesale customer but it is now not showing in the retail either.

    I need the volume discount to show in the retail but not the wholesale. Can someone tell me what to do?

 

 

Similar Threads

  1. v151 Trying to offer quantity discounts to wholesale customers only
    By threecreeks in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 5
    Last Post: 30 Jan 2014, 05:46 PM
  2. Need to have wholesale pricing with quantity discounts for wholesale customers only..
    By littleturtlemama in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 4
    Last Post: 16 Dec 2010, 04:47 AM
  3. How to disable quantity discounts for wholesale users?
    By mldnkslvc in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 4
    Last Post: 2 Feb 2010, 09:39 PM
  4. Hide quantity discounts for general customers, show for groups only?
    By swamyg1 in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 3
    Last Post: 16 Nov 2009, 09:22 PM
  5. Need to have wholesale pricing with quantity discounts for wholesale customers only..
    By littleturtlemama in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 0
    Last Post: 29 Sep 2007, 10:01 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