Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1
    Join Date
    Jul 2011
    Location
    Southport
    Posts
    11
    Plugin Contributions
    0

    Default Exclude items from the Group Pricing Discount

    Hi everyone, this is my first post.
    I am currently setting up my first zencart site.
    Im making pretty good progress, but I have a problem.

    I have set up the group pricing to allow a % discount on items, however, I want to know if there is any module/php alteration to exclude items marked as "OEM" in the manufacturer option, or only allow items marked "Compatible" in the manufacturer option.

    I have got the Online Group Pricing module by Toni installed (To show the discount on each item instead of the cart), so please take this into account if I have to replace core files.

    Many thanks

    Ray

    v1.3.9h

  2. #2
    Join Date
    Jul 2011
    Location
    Southport
    Posts
    11
    Plugin Contributions
    0

    Default Re: Exclude items from the Group Pricing Discount

    Surely somebody knows how to do this ?

    I sort of know what I want it to do, but dont know how about doing it.

    I think this may work....

    Create an extra field somewhere in the database called "excludefromsales", and assign it to a checkbox next to either, the manufacturer or the item.

    Then in the functions_prices.php or html_output.php, or both files, a function that does something like....

    "if excludefromsales = 0 {do this with discount applied}
    else
    {do this without discount applied}"

    I know it is probably simple for some of you guys, but without a lot of trial and error, its not something simple for me

    Thanks in advance for any help.

  3. #3
    Join Date
    Apr 2008
    Posts
    446
    Plugin Contributions
    1

    Default Re: Exclude items from the Group Pricing Discount

    very interested in this as well... i've tried many codes and nothing seems to work
    M.Valenti
    Contemporary Artist - Entrepreneur
    http://www.manuelavalenti.com - http://www.byvalenti.com

  4. #4
    Join Date
    Jul 2011
    Location
    Southport
    Posts
    11
    Plugin Contributions
    0

    Default Re: Exclude items from the Group Pricing Discount

    I think the perfect guy to help on this would be Toni, the creator of the online group mod.

    I have got this far, I have added a session variable named "$customer_manufacturer_group" and done the "if" statement similar to my first post.
    This does remove the discount, but on all products, and not just those in my category number 6.

    Can anybody help ?

    My additions are in green below.

    } else {
    session_start();
    $_SESSION['customer_group_id'] = array();
    $_SESSION['customer_group_id']['customer_id'] = $customer_id;
    $_SESSION['customer_group_id']['group_id'] = $customer_group_id;
    $_SESSION['customer_group_id']['discount'] = $customer_group_percentage;
    $_SESSION['customer_group_id']['method'] = $customer_group_method;
    $_SESSION['manufacturers']['manufacturers_id'] = $customer_manufacturer_group;
    }
    }

    switch($customer_group_method) {
    case 1:
    if ($customer_manufacturer_group =6) {
    $display_normal_price = round($display_normal_price,4) * $qty;
    return $display_normal_price;}
    else
    {
    $display_normal_price = round($display_normal_price * (1 - ($customer_group_percentage/100)),4) * $qty;
    return $display_normal_price;}
    break;

    case 2:
    $display_normal_price = round($display_normal_price / (1 + ($customer_group_percentage/100)),4) * $qty;
    return $display_normal_price;
    break;

    default:
    // regular price
    $display_normal_price = round($display_normal_price,4) * $qty;
    return $display_normal_price;
    break;
    }
    Last edited by MerseyRay; 26 Jul 2011 at 04:34 PM.

  5. #5
    Join Date
    Apr 2008
    Posts
    446
    Plugin Contributions
    1

    Default Re: Exclude items from the Group Pricing Discount

    What file are you editing??
    Everywhere I looked mentions to edit ot_group_pricing.php and edit the deductions portion. I've tried but I'm not able to make it work

    PHP Code:
      function calculate_deductions($order_total) {
        global 
    $db$order;
        
    $od_amount = array();
        
    $orderTotal $this->get_order_total();
        
    $orderTotalTax $orderTotal['tax'];
        
    $group_query $db->Execute("select customers_group_pricing from " TABLE_CUSTOMERS " where customers_id = '" . (int)$_SESSION['customer_id'] . "'");
        if (
    $group_query->fields['customers_group_pricing'] != '0') {
          
    $group_discount $db->Execute("select group_name, group_percentage from " TABLE_GROUP_PRICING "
                                          where group_id = '" 
    . (int)$group_query->fields['customers_group_pricing'] . "'");
          
    $gift_vouchers $_SESSION['cart']->gv_only();
          
    $discount = ($order_total $gift_vouchers) * $group_discount->fields['group_percentage'] / 100;
          
    $od_amount['total'] = round($discount2);
          
    $ratio $od_amount['total']/$order_total;
          
    /**
           * when calculating the ratio add some insignificant values to stop divide by zero errors
           */
          
    switch ($this->calculate_tax) {
            case 
    'None':
              if (
    $this->include_tax) {
                
    reset($order->info['tax_groups']);
                foreach (
    $order->info['tax_groups'] as $key=>$value) {
                  
    $od_amount['tax_groups'][$key] = $order->info['tax_groups'][$key] * $ratio;
                }
              } 
    M.Valenti
    Contemporary Artist - Entrepreneur
    http://www.manuelavalenti.com - http://www.byvalenti.com

  6. #6
    Join Date
    Jul 2011
    Location
    Southport
    Posts
    11
    Plugin Contributions
    0

    Default Re: Exclude items from the Group Pricing Discount

    Ill have a look in that file later on today.
    Ive been editing the includes/functions/functions_prices.php file.

    Im having trouble setting the variable "$customer_manufacturer_group"

    Ive added this green text below the existing black text

    $_SESSION['customer_group_id']['method'] = $customer_group_method;
    $_SESSION['manufacturers']['manufacturers_id'] = $product_manufacturer_group;
    }

    and trying to echo the result to the screen, but i can seem to get this to work

  7. #7
    Join Date
    Jun 2006
    Posts
    298
    Plugin Contributions
    0

    Default Re: Exclude items from the Group Pricing Discount

    Did anyone ever figure this out?

  8. #8
    Join Date
    Sep 2006
    Posts
    163
    Plugin Contributions
    1

    Default Re: Exclude items from the Group Pricing Discount

    Seems to me that there is a fundamental error in the logic in the question.

    The Group discount works on the order total, so there are three possiblities:
    1. The order has no "excluded" items, so the group discount should be applied
    2. The order is entirely made up of "excluded" items, so no groupd discount is available
    3. The order has some "excluded" and some not "excluded". What happens then?

    Or have I missed something?

  9. #9
    Join Date
    Mar 2009
    Posts
    609
    Plugin Contributions
    0

    Default Re: Exclude items from the Group Pricing Discount

    EXACTLY this, in example 3, discount needs to be on a per product basis not order total.

    Quote Originally Posted by hairydog View Post
    Seems to me that there is a fundamental error in the logic in the question.

    The Group discount works on the order total, so there are three possiblities:
    1. The order has no "excluded" items, so the group discount should be applied
    2. The order is entirely made up of "excluded" items, so no groupd discount is available
    3. The order has some "excluded" and some not "excluded". What happens then?

    Or have I missed something?

  10. #10
    Join Date
    Sep 2006
    Posts
    163
    Plugin Contributions
    1

    Default Re: Exclude items from the Group Pricing Discount

    Quote Originally Posted by DigitalShadow View Post
    EXACTLY this, in example 3, discount needs to be on a per product basis not order total.
    That means calculating the price on a per-item basis, and it is no longer an order total discount.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. ZC 1.5 Group Pricing is Doubling the Discount
    By independenteasel in forum Managing Customers and Orders
    Replies: 0
    Last Post: 15 Aug 2013, 09:18 PM
  2. group pricing exclude some master categories
    By count in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 0
    Last Post: 20 Jan 2013, 11:42 PM
  3. v150 Exclude already discounted items from Group discounts
    By Defkon1 in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 0
    Last Post: 2 Sep 2012, 08:35 AM
  4. v139h Exclude category or product from group discount
    By abcisme in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 0
    Last Post: 10 Aug 2012, 02:51 PM
  5. Exclude attributes from discounting in online group pricing
    By danwebman in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 27 Jan 2012, 08:02 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