Page 5 of 6 FirstFirst ... 3456 LastLast
Results 41 to 50 of 60
  1. #41
    Join Date
    Sep 2009
    Location
    Toronto, Canada
    Posts
    149
    Plugin Contributions
    0

    Default Re: Minimum shipping fee

    Quote Originally Posted by Ajeh View Post
    Customize the code from:
    Code:
            $methods[] = array('id' => $type,
                               'title' => $this->types[$type],
                               'cost' => ($cost + MODULE_SHIPPING_UPS_HANDLING) * $shipping_num_boxes);
    to now force the amount ...
    Code:
    if ($cost < 7.95) {
            $methods[] = array('id' => $type,
                               'title' => $this->types[$type],
                               'cost' => (7.95 + MODULE_SHIPPING_UPS_HANDLING) * $shipping_num_boxes);
    } else {
            $methods[] = array('id' => $type,
                               'title' => $this->types[$type],
                               'cost' => ($cost + MODULE_SHIPPING_UPS_HANDLING) * $shipping_num_boxes);
    }
    Will this also work in the "Per Unit"(by weight) shipping module?
    Lisa

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

    Default Re: Minimum shipping fee

    Same concept but you have to adapt the code for that shipping module ...
    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!]
    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. #43
    Join Date
    Sep 2009
    Location
    Toronto, Canada
    Posts
    149
    Plugin Contributions
    0

    Default Re: Minimum shipping fee

    Okay sounds easy,(probably isn't) lol, I'm going to give it a try.

  4. #44
    Join Date
    Sep 2009
    Location
    Toronto, Canada
    Posts
    149
    Plugin Contributions
    0

    help question Re: Minimum shipping fee

    Okay so putting that bit of code into the perweightunit.php didn't work..... can somebody tell me where to put the code in and if it would be the same code that was used for the USPS module?
    Thanks again!
    Lisa

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

    Default Re: Minimum shipping fee

    This is a constant:
    MODULE_SHIPPING_UPS_HANDLING

    all of the shipping modules have unique constants ...

    For UPS it uses:
    MODULE_SHIPPING_UPS_HANDLING

    For Per Unit it uses:
    MODULE_SHIPPING_PERWEIGHTUNIT_HANDLING

    See if you forgot to change ALL of the constants to match the shipping module you are working with ...
    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!]
    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. #46
    Join Date
    Sep 2009
    Location
    Toronto, Canada
    Posts
    149
    Plugin Contributions
    0

    Default Re: Minimum shipping fee

    Hi Ajeh

    All I changed is the two lines below (in red), because I really haven't learned as much as I need to to understand why I'm changing it, but I thought that I would at least give it a try. I kind of knew that it probably wouldn't work out to be that easy.

    <?php
    /**
    * @package shippingMethod
    * @copyright Copyright 2003-2006 Zen Cart Development Team
    * @copyright Portions Copyright 2003 osCommerce
    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    * @version $Id: perweightunit.php 3308 2006-03-29 08:21:33Z ajeh $
    */
    /**
    * "Per Weight Unit" shipping module, allowing you to offer per-unit-rate shipping options
    *
    */
    class perweightunit extends base {
    /**
    * $code determines the internal 'code' name used to designate "this" payment module
    *
    * @var string
    */
    var $code;
    /**
    * $title is the displayed name for this payment method
    *
    * @var string
    */
    var $title;
    /**
    * $description is a soft name for this payment method
    *
    * @var string
    */
    var $description;
    /**
    * module's icon
    *
    * @var string
    */
    var $icon;
    /**
    * $enabled determines whether this module shows or not... during checkout.
    *
    * @var boolean
    */
    var $enabled;
    /**
    * Constructor
    *
    * @return perweightunit
    */
    function perweightunit() {
    global $order, $db;

    $this->code = 'perweightunit';
    $this->title = MODULE_SHIPPING_PERWEIGHTUNIT_TEXT_TITLE;
    $this->description = MODULE_SHIPPING_PERWEIGHTUNIT_TEXT_DESCRIPTION;
    $this->sort_order = MODULE_SHIPPING_PERWEIGHTUNIT_SORT_ORDER;
    $this->icon = '';
    $this->tax_class = MODULE_SHIPPING_PERWEIGHTUNIT_TAX_CLASS;
    $this->tax_basis = MODULE_SHIPPING_PERWEIGHTUNIT_TAX_BASIS;

    // disable only when entire cart is free shipping
    if (zen_get_shipping_enabled($this->code)) {
    $this->enabled = ((MODULE_SHIPPING_PERWEIGHTUNIT_STATUS == 'True') ? true : false);
    }

    if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_PERWEIGHTUNIT_ZONE > 0) ) {
    $check_flag = false;
    $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . "
    where geo_zone_id = '" . MODULE_SHIPPING_PERWEIGHTUNIT_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) {
    $this->enabled = false;
    }
    }
    }
    /**
    * Obtain quote from shipping system/calculations
    *
    * @param string $method
    * @return array
    */
    function quote($method = '') {
    global $order, $shipping_weight;

    $total_weight_units = $shipping_weight;
    if ($cost < 15.00) {
    $this->quotes = array('id' => $this->code,
    'module' => MODULE_SHIPPING_PERWEIGHTUNIT_TEXT_TITLE,
    'methods' => array(array('id' => $this->code,
    'title' => MODULE_SHIPPING_PERWEIGHTUNIT_TEXT_WAY,
    'cost' => (15.00 + MODULE_SHIPPING_PERWEIGHTUNIT_COST * $total_weight_units)
    + MODULE_SHIPPING_PERWEIGHTUNIT_HANDLING)));

    if ($this->tax_class > 0) {
    $this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
    }

    if (zen_not_null($this->icon)) $this->quotes['icon'] = zen_image($this->icon, $this->title);

    return $this->quotes;
    }
    /**
    * Check to see whether module is installed
    *
    * @return boolean
    */
    function check() {
    global $db;
    if (!isset($this->_check)) {
    $check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_PERWEIGHTUNIT_STATUS'");
    $this->_check = $check_query->RecordCount();
    }
    return $this->_check;
    }
    /**
    * Install the shipping module and its configuration settings
    *
    */
    function install() {
    global $db;
    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Per Weight Unit Shipping', 'MODULE_SHIPPING_PERWEIGHTUNIT_STATUS', 'True', 'Do you want to offer per unit rate shipping?<br /><br />Product Quantity * Units (products_weight) * Cost per Unit', '6', '0', 'zen_cfg_select_option(array(\'True\', \'False\'), ', now())");
    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping Cost per Unit', 'MODULE_SHIPPING_PERWEIGHTUNIT_COST', '1', 'NOTE: When using this Shipping Module be sure to check the Tare settings in the Shipping/Packaging and set the Largest Weight high enough to handle the price, such as 5000.00 and the adjust the settings on Small and Large packages which will add to the price as well.<br /><br />The shipping cost will be used to determin shipping charges based on: Product Quantity * Units (products_weight) * Cost per Unit - in an order that uses this shipping method.', '6', '0', now())");
    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_PERWEIGHTUNIT_HANDLING', '0', 'Handling fee for this shipping method.', '6', '0', now())");
    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_PERWEIGHTUNIT_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'zen_get_tax_class_title', 'zen_cfg_pull_down_tax_classes(', now())");
    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Tax Basis', 'MODULE_SHIPPING_PERWEIGHTUNIT_TAX_BASIS', 'Shipping', 'On what basis is Shipping Tax calculated. Options are<br />Shipping - Based on customers Shipping Address<br />Billing Based on customers Billing address<br />Store - Based on Store address if Billing/Shipping Zone equals Store zone', '6', '0', 'zen_cfg_select_option(array(\'Shipping\', \'Billing\', \'Store\'), ', now())");
    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_PERWEIGHTUNIT_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'zen_get_zone_class_title', 'zen_cfg_pull_down_zone_classes(', now())");
    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_PERWEIGHTUNIT_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
    }
    /**
    * Remove the module and all its settings
    *
    */
    function remove() {
    global $db;
    $db->Execute("delete from " . TABLE_CONFIGURATION . " where configuration_key LIKE 'MODULE_SHIPPING_PERWEIGHTUNIT_%'");
    }
    /**
    * Internal list of configuration keys used for configuration of the module
    *
    * @return array
    */
    function keys() {
    return array('MODULE_SHIPPING_PERWEIGHTUNIT_STATUS', 'MODULE_SHIPPING_PERWEIGHTUNIT_COST', 'MODULE_SHIPPING_PERWEIGHTUNIT_HANDLING', 'MODULE_SHIPPING_PERWEIGHTUNIT_TAX_CLASS', 'MODULE_SHIPPING_PERWEIGHTUNIT_TAX_BASIS', 'MODULE_SHIPPING_PERWEIGHTUNIT_ZONE', 'MODULE_SHIPPING_PERWEIGHTUNIT_SORT_ORDER');
    }
    }
    ?>

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

    Default Re: Minimum shipping fee

    Try using this ...
    Code:
        $total_weight_units = $shipping_weight;
        if (MODULE_SHIPPING_PERWEIGHTUNIT_COST * $total_weight_units < 15.00) {
        $this->quotes = array('id' => $this->code,
                              'module' => MODULE_SHIPPING_PERWEIGHTUNIT_TEXT_TITLE,
                              'methods' => array(array('id' => $this->code,
                                                       'title' => MODULE_SHIPPING_PERWEIGHTUNIT_TEXT_WAY,
                                                       'cost' => (15.00)
                                                                  + MODULE_SHIPPING_PERWEIGHTUNIT_HANDLING)));
        } else {
        $this->quotes = array('id' => $this->code,
                              'module' => MODULE_SHIPPING_PERWEIGHTUNIT_TEXT_TITLE,
                              'methods' => array(array('id' => $this->code,
                                                       'title' => MODULE_SHIPPING_PERWEIGHTUNIT_TEXT_WAY,
                                                       'cost' => (MODULE_SHIPPING_PERWEIGHTUNIT_COST * $total_weight_units)
                                                                  + MODULE_SHIPPING_PERWEIGHTUNIT_HANDLING)));
        }
    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!]
    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!

  8. #48
    Join Date
    Sep 2009
    Location
    Toronto, Canada
    Posts
    149
    Plugin Contributions
    0

    Default Re: Minimum shipping fee

    Thanks so much Linda, it worked fantastically! I just couldn't do this without the amazing help from several people on this forum. I really hope that I am able to give back the same way eventually. Thank you so very much.
    Lisa

  9. #49
    Join Date
    Jan 2011
    Posts
    4
    Plugin Contributions
    0

    Default Re: Minimum shipping fee

    I'm using the per item shipping fee and need a minimum shipping cost of $20. Can't seem to make it work by altering the code. Could be 'cause it's past 2 am and I'm tired, but any help would be appreciated.

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

    Default Re: Minimum shipping fee

    Per Unit perweightunit is based on the total weight of the order and that weight is used to calculate the shipping charges ...

    If your units are set to 1.00 then you can just alter the code:
    Code:
        $total_weight_units = $shipping_weight;
        // bof: minimum 20.00
        if ($total_weight < 20.00) {
          $total_weight = 20.00;
        }
        // eof: minimum 20.00
    
    by adding the code in RED below the code in BLACK ...
    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!]
    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 5 of 6 FirstFirst ... 3456 LastLast

Similar Threads

  1. Minimum Order Fee module
    By jdw1979 in forum General Questions
    Replies: 13
    Last Post: 30 Nov 2011, 04:44 PM
  2. Minimum FIRST TIME order fee
    By jdw1979 in forum General Questions
    Replies: 20
    Last Post: 2 Nov 2011, 05:37 PM
  3. Minimum Order Fee
    By prosam in forum Managing Customers and Orders
    Replies: 5
    Last Post: 17 Jun 2008, 04:35 PM
  4. Set minimum shipping fee
    By mattys in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 5 Jan 2007, 11:03 AM
  5. Added charge, one-time deposit/fee, minimum order
    By Pozitech in forum Managing Customers and Orders
    Replies: 2
    Last Post: 7 Nov 2006, 03:40 PM

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