Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20
  1. #11
    Join Date
    Jun 2012
    Location
    Milton Keynes, United Kingdom
    Posts
    23
    Plugin Contributions
    0

    Default Re: Fee if certain items are ordered

    I'm on ZC v1.5.0 and am trying to do exactly the same i.e. add a surcharge per order if certain items are in the cart. Is there a way to do this on the ceon advanced shipper module? I currently have a lot of rules configured in advanced shipper per category and per manufacturer etc. but can't figure out how to do this - I've been trying on and off for weeks any help would be appreciated. Thanks, Simon

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

    Default Re: Fee if certain items are ordered

    You might look at the Extra Order Fee add on plugin and see if you can't adapt that to what you need:
    http://www.zen-cart.com/downloads.php?do=file&id=1407
    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. #13
    Join Date
    Jun 2012
    Location
    Milton Keynes, United Kingdom
    Posts
    23
    Plugin Contributions
    0

    Default Re: Fee if certain items are ordered

    Quote Originally Posted by Ajeh View Post
    You might look at the Extra Order Fee add on plugin and see if you can't adapt that to what you need:
    http://www.zen-cart.com/downloads.php?do=file&id=1407
    Thanks for that I'll give it a go now.

  4. #14
    Join Date
    Jun 2012
    Location
    Milton Keynes, United Kingdom
    Posts
    23
    Plugin Contributions
    0

    Default Re: Fee if certain items are ordered

    Just installed your module Ajeh and the best option I think is to set the Extra Order Fee module to bill everyone £10, then I need to somehow add the following code so I can include the items where a surcharge is applicable.. sorry to bother you, I'm not good when it comes to working out the code. Where would the code below need adding and would I change references from MODULE_SHIPPING_FLAT_TEXT_WAY to MODULE_ORDER_TOTAL_EXTRAORDERFEE_ORDER_FEE

    Code:
    // bof: add additional charge if products 12 or 15 are in the cart
          global $cart;
          $chk_products = 0;
          $extra_shipping = 0.00;
          $chk_products += $_SESSION['cart']->in_cart_check('products_id','12');
          $chk_products += $_SESSION['cart']->in_cart_check('products_id','15');
          if ($chk_products > 0 ) {
            $extra_shipping = 5.00;
          }
          $this->quotes = array('id' => $this->code,
                                'module' => MODULE_SHIPPING_FLAT_TEXT_TITLE,
                                'methods' => array(array('id' => $this->code,
                                                         'title' => MODULE_SHIPPING_FLAT_TEXT_WAY,
                                                         'cost' => MODULE_SHIPPING_FLAT_COST + $extra_shipping)));
    // eof: add additional charge if products 12 or 15 are in the cart
    Thanks, Simon

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

    Default Re: Fee if certain items are ordered

    You can try this for the function process ... but if you need tax, you will have to work on this as I do not think it is quiet working right ...
    Code:
        function process() {
          global $order, $currencies;
    
          if (MODULE_ORDER_TOTAL_EXTRAORDERFEE_ORDER_FEE == 'true') {
    
          $pass = true;
          if (MODULE_ORDER_TOTAL_EXTRAORDERFEE_ZONE > 0) {
    // bof: check zone and add extra fee
            global $db;
            $pass = false;
            $check_flag = false;
    // based on Delivery zone $order->delivery to use Payment zone change to $order->billing in two places
            $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_ORDER_TOTAL_EXTRAORDERFEE_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
            while (!$check->EOF) {
              if ($check->fields['zone_id'] < 1) {
                $check_flag = true;
                break;
              } elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
                $check_flag = true;
                break;
              }
              $check->MoveNext();
            }
    
            if ($check_flag == false) {
              $pass = false;
            } else {
              $pass = true;
            }
    // eof: check zone and add extra fee
          }
    
            if ($pass == true) {
                $tax_address = zen_get_tax_locations();
                $tax = zen_get_tax_rate(MODULE_ORDER_TOTAL_EXTRAORDERFEE_TAX_CLASS, $tax_address['country_id'], $tax_address['zone_id']);
                $tax_description = zen_get_tax_description(MODULE_ORDER_TOTAL_EXTRAORDERFEE_TAX_CLASS, $tax_address['country_id'], $tax_address['zone_id']);
    
    /*
    // calculate from flat fee or percentage
                if (substr(MODULE_ORDER_TOTAL_EXTRAORDERFEE_FEE, -1) == '%') {
                  $extra_order_fee = ($order->info['subtotal'] * (MODULE_ORDER_TOTAL_EXTRAORDERFEE_FEE/100));
                } else {
                  $extra_order_fee = MODULE_ORDER_TOTAL_EXTRAORDERFEE_FEE;
                }
    */
    
    // bof: add additional charge if products 12 or 15 are in the cart
          global $cart;
          $chk_products = 0;
          $extra_shipping = 0.00;
          $chk_products += $_SESSION['cart']->in_cart_check('products_id','12');
          $chk_products += $_SESSION['cart']->in_cart_check('products_id','15');
          if ($chk_products > 0 ) {
            $extra_shipping = 5.00;
          }
          $extra_order_fee = $extra_shipping;
          if ($extra_order_fee > 0) {
                $order->info['tax'] += zen_calculate_tax($extra_order_fee, $tax);
                $order->info['tax_groups']["$tax_description"] += zen_calculate_tax($extra_order_fee, $tax);
                $order->info['total'] += $extra_order_fee + zen_calculate_tax($extra_order_fee, $tax);
                if (DISPLAY_PRICE_WITH_TAX == 'true') {
                  $extra_order_fee += zen_calculate_tax($extra_order_fee, $tax);
                }
    
                $this->output[] = array('title' => $this->title . ':',
                                        'text' => $currencies->format($extra_order_fee, true, $order->info['currency'], $order->info['currency_value']),
                                        'value' => $extra_order_fee);
          } else {
    // no charges to display
          }
    // eof: add additional charge if products 12 or 15 are in the cart
    
            } else {
    //echo 'TEST EXTRA CHARGE NO PASS!';
            }
          }
        }
    
        function check() {
    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!

  6. #16
    Join Date
    Aug 2009
    Location
    Bedford, England
    Posts
    966
    Plugin Contributions
    0

    Default Re: Fee if certain items are ordered

    i highly recommend Ceon Advanced Shipping, its very versitile and you do not need to change code to customise a shipping option, you can set shipping specific to products or categories as well as global config
    Phil Rogers
    A problem shared is a problem solved.

  7. #17
    Join Date
    Jun 2012
    Location
    Milton Keynes, United Kingdom
    Posts
    23
    Plugin Contributions
    0

    Default Re: Fee if certain items are ordered

    Quote Originally Posted by philip937 View Post
    i highly recommend Ceon Advanced Shipping, its very versitile and you do not need to change code to customise a shipping option, you can set shipping specific to products or categories as well as global config
    I agree, the module is tremendous - as our structure is dropshipping this enables us to specify custom rules per supplier (usually a specific category or manufacturer).

  8. #18
    Join Date
    Jun 2012
    Location
    Milton Keynes, United Kingdom
    Posts
    23
    Plugin Contributions
    0

    Default Re: Fee if certain items are ordered

    Thanks Ajeh, I'll let you know how I get on with it! I appreciate your help

  9. #19
    Join Date
    Jun 2012
    Location
    Milton Keynes, United Kingdom
    Posts
    23
    Plugin Contributions
    0

    Default Re: Fee if certain items are ordered

    Works a treat! Thank you very much for your help

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

    Default Re: Fee if certain items are ordered

    Thanks for the update that this is working 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!

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. v139h Automatic message in checkout/shopping basket when certain items are selected
    By christospur in forum Setting Up Categories, Products, Attributes
    Replies: 10
    Last Post: 8 Apr 2013, 06:25 PM
  2. v150 Stopping items on menu to be ordered after a certain time
    By mkyle in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 16 Aug 2012, 01:40 PM
  3. How do I set up a separate handling fee for certain items?
    By flipperry in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 9 Aug 2009, 04:58 PM
  4. Table Rate shipping PLUS a handling fee for certain items
    By marvin in forum Built-in Shipping and Payment Modules
    Replies: 13
    Last Post: 19 Apr 2009, 05:20 PM
  5. Handling fee only on certain items
    By Hound in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 16 Jul 2007, 03:04 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