Results 1 to 10 of 13

Hybrid View

  1. #1
    Join Date
    Feb 2008
    Location
    Tx gulf coast
    Posts
    126
    Plugin Contributions
    0

    Default Low order fee by manufacturer?

    Can this section of the ot_loworderfee.php be edited to reflect manufacturer instead of locality?

    if (MODULE_ORDER_TOTAL_LOWORDERFEE_LOW_ORDER_FEE == 'true') {
    switch (MODULE_ORDER_TOTAL_LOWORDERFEE_DESTINATION) {
    case 'national':
    if ($order->delivery['country_id'] == STORE_COUNTRY) $pass = true; break;
    case 'international':
    if ($order->delivery['country_id'] != STORE_COUNTRY) $pass = true; break;
    case 'both':
    $pass = true; break;
    default:
    $pass = false; break;
    }

    What would I need to do to have options for either manufacturer or category?

    Thanks..
    Last edited by CabinetGuy; 7 Sep 2014 at 05:50 PM.

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

    Default Re: Low order fee by manufacturer?

    Can you give an example of what you want to do?

    Is this just for 1 particular manufacturer? Or is it for many?

    Is this just for 1 category? Or is it for many?

    On the category/categories, would this be the master_categories_id? Or, would you want any Product in a Category with subcategories?
    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!

  3. #3
    Join Date
    Feb 2008
    Location
    Tx gulf coast
    Posts
    126
    Plugin Contributions
    0

    Default Re: Low order fee by manufacturer?

    Thanks Ajeh...

    I sell a product, cabinet doors and drawer fronts, offered by three or more manufacturers.... at least two of them have a minimum order fee to me which I must pass on. So, there would most likely need to be something like a 'tick box' in the manufacturer information that designates this as such.

    Let me know if other info is needed.

    TIA

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

    Default Re: Low order fee by manufacturer?

    If you were able to calculate the Total amount for the combined total of the 1-3 manufacturers products in the cart, would that be able to be used for the low order fee?
    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
    Feb 2008
    Location
    Tx gulf coast
    Posts
    126
    Plugin Contributions
    0

    Default Re: Low order fee by manufacturer?

    Ajeh, the low order by mfg would have to stand alone for each mfg. So, if mfg "a" has minimum of $40, then it must be tested as a total for that unique mfg. Same for mfg "b", "c", etc...this allows for as many low order fees as necessary based on the separate mfg's. Normally, a customer does not "cross the mfg lines" when buying products, but it is a remote possibility. I only have two mfgs at this time that even have a low order fee...so I don't see this as too big of an issue, going forward...

    tia

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

    Default Re: Low order fee by manufacturer?

    You can do this by editing the Order Total module:
    /includes/modules/order_total/ot_loworderfee.php

    and replace the whole function process with the new code:
    Code:
        function process() {
          global $order, $currencies;
    
          $chk_manufacturers_1_id = 3; // manufacturers_id 3
          $chk_manufacturers_1_total = 0;
          $chk_manufacturers_1_min = 30.00;
          $chk_manufacturers_1_extra = 3.00;
    
          $chk_manufacturers_2_id = 4; // manufacturers_id 4
          $chk_manufacturers_2_total = 0;
          $chk_manufacturers_2_min = 40.00;
          $chk_manufacturers_2_extra = 4.00;
    
          $products = $_SESSION['cart']->get_products();
    //echo '<pre>'; echo print_r($products); echo '</pre>';
          for ($i=0, $n=sizeof($products); $i<$n; $i++) {
            $product_id = $products[$i]['id'];
            $ppe = $products[$i]['final_price'];
            $ppt = $ppe * $products[$i]['quantity'];
            $productsPriceTotal = $ppt + $products[$i]['onetime_charges'];
    //echo 'product_id: ' . $product_id . ' $ppt: ' . $ppt . ' qty: ' . $products[$i]['quantity'] . ' $productsPriceTotal: ' . $productsPriceTotal . '<br>';
            if (zen_products_lookup($product_id, 'manufacturers_id') == $chk_manufacturers_1_id && (int)$product_id == (int)$products[$i]['id']) {
              $chk_manufacturers_1_total += $productsPriceTotal;
    //echo '$chk_manufacturers_1_id: ' . $chk_manufacturers_1_id . ' $product_id: ' . $product_id . ' $chk_manufacturers_1_total: ' . $productsPriceTotal . '<br>';
            }
            if (zen_products_lookup($product_id, 'manufacturers_id') == $chk_manufacturers_2_id && (int)$product_id == (int)$products[$i]['id']) {
              $chk_manufacturers_2_total += $productsPriceTotal;
    //echo '$chk_manufacturers_2_id: ' . $chk_manufacturers_2_id . ' $product_id: ' . $product_id . ' $chk_manufacturers_2_total: ' . $productsPriceTotal . '<br>';
            }
          } // end FOR loop
            $extra_fee = ($chk_manufacturers_1_total < $chk_manufacturers_1_min ? $chk_manufacturers_1_extra : 0) + ($chk_manufacturers_2_total < $chk_manufacturers_2_min ? $chk_manufacturers_2_extra : 0);
    
            if ($extra_fee > 0) {
              $tax_address = zen_get_tax_locations();
              $tax = zen_get_tax_rate(MODULE_ORDER_TOTAL_LOWORDERFEE_TAX_CLASS, $tax_address['country_id'], $tax_address['zone_id']);
              $tax_description = zen_get_tax_description(MODULE_ORDER_TOTAL_LOWORDERFEE_TAX_CLASS, $tax_address['country_id'], $tax_address['zone_id']);
    
    // calculate from flat fee or percentage
              $low_order_fee = $extra_fee;
    
              $order->info['tax'] += zen_calculate_tax($low_order_fee, $tax);
              $order->info['tax_groups']["$tax_description"] += zen_calculate_tax($low_order_fee, $tax);
              $order->info['total'] += $low_order_fee + zen_calculate_tax($low_order_fee, $tax);
              if (DISPLAY_PRICE_WITH_TAX == 'true') {
                $low_order_fee += zen_calculate_tax($low_order_fee, $tax);
              }
    
              $this->output[] = array('title' => $this->title . ':',
                                      'text' => $currencies->format($low_order_fee, true, $order->info['currency'], $order->info['currency_value']),
                                      'value' => $low_order_fee);
          }
        }
    The set the variables to match your manufacturers_id, minimum, extra fee for each set, example:
    $chk_manufacturers_1_id = 3; // manufacturers_id 3
    $chk_manufacturers_1_total = 0;
    $chk_manufacturers_1_min = 30.00;
    $chk_manufacturers_1_extra = 3.00;

    This would be manufacturers_id 3, minimum $30.00 and extra fee $3.00 ...
    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. Low Order Fee
    By tsrplatelayer in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 1
    Last Post: 31 Jul 2016, 08:58 AM
  2. Low Order Fee
    By loaner in forum General Questions
    Replies: 3
    Last Post: 10 Sep 2011, 12:50 AM
  3. Low Order Fee
    By Mr_B in forum Basic Configuration
    Replies: 2
    Last Post: 28 May 2008, 06:40 PM
  4. low order fee
    By CCD in forum Managing Customers and Orders
    Replies: 2
    Last Post: 15 Nov 2007, 07:12 AM

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