Results 1 to 7 of 7
  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
    199
    Plugin Contributions
    0

    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
    199
    Plugin Contributions
    0

    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
    226
    Plugin Contributions
    0

    Default Re: Exclude items from the Group Pricing Discount

    Did anyone ever figure this out?

 

 

Similar Threads

  1. Sale/Special to exclude group discount
    By GarethJ in forum Setting Up Specials and SaleMaker
    Replies: 3
    Last Post: 14 Apr 2011, 04:16 AM
  2. group pricing discount?
    By balihr in forum Managing Customers and Orders
    Replies: 2
    Last Post: 29 Jan 2009, 11:26 PM
  3. Email to exclude discount group, etc
    By elishama3 in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 0
    Last Post: 4 Mar 2008, 06:09 AM
  4. Group Pricing + Quantity Discount
    By zilwiz in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 5
    Last Post: 20 Dec 2006, 01:48 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
  •