Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 22
  1. #11
    Join Date
    Jan 2009
    Posts
    84
    Plugin Contributions
    0

    Default Re: Clone Flat Rate Shipping with Zone

    I am not familiar with the term "fixed files" but I assume you meant to reupload the flatcanada files. This intalls the module. Still same error message and can't successfully remove the module in the admin.

    Oh, I just noticed that the name showing in the list of modules in the admin reads FLATCANADA. Don't know if that matters but all the other modules are listed in lower case. Maybe I misunderstood your earlier instructions. I had changed all instances of flatcanada to FLATCANADA in the files.
    Last edited by nfallat; 28 Jul 2012 at 08:58 PM.

  2. #12
    Join Date
    Jan 2009
    Posts
    84
    Plugin Contributions
    0

    Default Re: Clone Flat Rate Shipping with Zone

    Oh, wait. I see what might be an issue. I'll update further.

  3. #13
    Join Date
    Jan 2009
    Posts
    84
    Plugin Contributions
    0

    Default Re: Clone Flat Rate Shipping with Zone

    I thought I saw something wrong but not. You have been really more than patient. I'll lay it all out one more time:

    includes/modules/shipping
    flatcanada.php


    class FLATCANADA {
    var $code, $title, $description, $icon, $enabled;

    // class constructor
    function FLATCANADA() {
    global $order, $db;

    $this->code = 'FLATCANADA';
    $this->title = MODULE_SHIPPING_FLATCANADA_TEXT_TITLE;
    $this->description = MODULE_SHIPPING_FLATCANADA_TEXT_DESCRIPTION;
    $this->sort_order = MODULE_SHIPPING_FLATCANADA_SORT_ORDER;
    $this->icon = '';
    $this->tax_class = MODULE_SHIPPING_FLATCANADA_TAX_CLASS;
    $this->tax_basis = MODULE_SHIPPING_FLATCANADA_TAX_BASIS;

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

    if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FLATCANADA_ZONE > 0) ) {
    $check_flag = false;
    $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_FLATCANADA_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;
    }
    }
    }

    // class methods
    function quote($method = '') {
    global $order;

    $this->quotes = array('id' => $this->code,
    'module' => MODULE_SHIPPING_FLATCANADA_TEXT_TITLE,
    'methods' => array(array('id' => $this->code,
    'title' => MODULE_SHIPPING_FLATCANADA_TEXT_WAY,
    'cost' => MODULE_SHIPPING_FLATCANADA_COST)));
    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;
    }

    function check() {
    global $db;
    if (!isset($this->_check)) {
    $check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_FLATCANADA_STATUS'");
    $this->_check = $check_query->RecordCount();
    }
    return $this->_check;
    }

    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 FLATCANADA Shipping', 'MODULE_SHIPPING_FLATCANADA_STATUS', 'True', 'Do you want to offer FLATCANADA rate shipping?', '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', 'MODULE_SHIPPING_FLATCANADA_COST', '5.00', 'The shipping cost for all orders using 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_FLATCANADA_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_FLATCANADA_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_FLATCANADA_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_FLATCANADA_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
    }

    function remove() {
    global $db;
    $db->Execute("delete from " . TABLE_CONFIGURATION . " where configuration_key like 'MODULE\_SHIPPING\_FLATCANADA\_%'");
    }

    function keys() {
    return array('MODULE_SHIPPING_FLATCANADA_STATUS', 'MODULE_SHIPPING_FLATCANADA_COST', 'MODULE_SHIPPING_FLATCANADA_TAX_CLASS', 'MODULE_SHIPPING_FLATCANADA_TAX_BASIS', 'MODULE_SHIPPING_FLATCANADA_ZONE', 'MODULE_SHIPPING_FLATCANADA_SORT_ORDER');
    }
    }
    ?>



    includes/languages/english/modules/shipping
    flatcanada.php


    define('MODULE_SHIPPING_FLATCANADA_TEXT_TITLE', 'Flat Rate');
    define('MODULE_SHIPPING_FLATCANADA_TEXT_DESCRIPTION', 'Flat Rate');
    define('MODULE_SHIPPING_FLATCANADA_TEXT_WAY', 'Best Way');
    ?>



    includes/languages/english/modules/mytemplate/shipping
    flatcanada.php



    define('MODULE_SHIPPING_FLATCANADA_TEXT_TITLE', 'Shipping to Canada<br>');
    define('MODULE_SHIPPING_FLATCANADA_TEXT_DESCRIPTION', 'FLATCANADA Rate');
    define('MODULE_SHIPPING_FLATCANADA_TEXT_WAY', 'Shipping to Canada on orders under $350 - Approx. 10-15 Business Days from when the manufacturer ships to us. Less if we have it in our own stock. Free shipping is available within Canada on orders over $350.');
    ?>



    Name:  flatcanada.jpg
Views: 139
Size:  18.9 KB

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

    Default Re: Clone Flat Rate Shipping with Zone

    Delete those files and start over ...

    Copy the files:
    /includes/modules/shipping/flat.php
    /includes/languages/english/modules/shipping/flat.php

    to the files:
    /includes/modules/shipping/flatcanada.php
    /includes/languages/english/modules/shipping/flatcanada.php

    Now edit the new files:
    /includes/modules/shipping/flatcanada.php
    /includes/languages/english/modules/shipping/flatcanada.php

    and do replacements ... these are case sensative ...

    Where you see:
    flat (lower case) replace with flatcanada (lower case)

    Where you see:
    FLAT (UPPER case) replace with FLATCANADA (UPPER case)

    Now load the files to the server ...

    Do you see any errors?

    If not, Install the flatcanada module and configure it ...

    Make sure that the Sort Order is a unique value that is NOT 0 ( NOT zero) ...
    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!

  5. #15
    Join Date
    Jan 2009
    Posts
    84
    Plugin Contributions
    0

    Default Re: Clone Flat Rate Shipping with Zone

    I was more detailed on the case as you said but still same problem, same error message. And when you say if no message then install the module, it installs by itself once the files are uploaded, shows red status, no sort order (but if you click edit it's sort 4) and can't remove it without deleting the flatcanada files. Here is the code one more time. I was sure if I was supposed to change "flat" at the top $Id but I did this time.

    // $Id: flatcanada.php 14498 2009-10-01 20:16:16Z ajeh $
    //

    class flatcanada {
    var $code, $title, $description, $icon, $enabled;

    // class constructor
    function flatcanada() {
    global $order, $db;

    $this->code = 'flatcanada';
    $this->title = MODULE_SHIPPING_FLATCANADA_TEXT_TITLE;
    $this->description = MODULE_SHIPPING_FLATCANADA_TEXT_DESCRIPTION;
    $this->sort_order = MODULE_SHIPPING_FLATCANADA_SORT_ORDER;
    $this->icon = '';
    $this->tax_class = MODULE_SHIPPING_FLATCANADA_TAX_CLASS;
    $this->tax_basis = MODULE_SHIPPING_FLATCANADA_TAX_BASIS;

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

    if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FLATCANADA_ZONE > 0) ) {
    $check_flag = false;
    $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_FLATCANADA_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;
    }
    }
    }

    // class methods
    function quote($method = '') {
    global $order;

    $this->quotes = array('id' => $this->code,
    'module' => MODULE_SHIPPING_FLATCANADA_TEXT_TITLE,
    'methods' => array(array('id' => $this->code,
    'title' => MODULE_SHIPPING_FLATCANADA_TEXT_WAY,
    'cost' => MODULE_SHIPPING_FLATCANADA_COST)));
    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;
    }

    function check() {
    global $db;
    if (!isset($this->_check)) {
    $check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_FLATCANADA_STATUS'");
    $this->_check = $check_query->RecordCount();
    }
    return $this->_check;
    }

    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 Flatcanada Shipping', 'MODULE_SHIPPING_FLATCANADA_STATUS', 'True', 'Do you want to offer flatcanada rate shipping?', '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', 'MODULE_SHIPPING_FLATCANADA_COST', '5.00', 'The shipping cost for all orders using 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_FLATCANADA_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_FLATCANADA_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_FLATCANADA_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_FLATCANADA_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
    }

    function remove() {
    global $db;
    $db->Execute("delete from " . TABLE_CONFIGURATION . " where configuration_key like 'MODULE\_SHIPPING\_FLATCANADA\_%'");
    }

    function keys() {
    return array('MODULE_SHIPPING_FLATCANADA_STATUS', 'MODULE_SHIPPING_FLATCANADA_COST', 'MODULE_SHIPPING_FLATCANADA_TAX_CLASS', 'MODULE_SHIPPING_FLATCANADA_TAX_BASIS', 'MODULE_SHIPPING_FLATCANADA_ZONE', 'MODULE_SHIPPING_FLATCANADA_SORT_ORDER');
    }
    }
    ?>




    // $Id: flatcanada.php 1969 2005-09-13 06:57:21Z drbyte $
    //

    define('MODULE_SHIPPING_FLATCANADA_TEXT_TITLE', 'Flat Rate');
    define('MODULE_SHIPPING_FLATCANADA_TEXT_DESCRIPTION', 'Flat Rate');
    define('MODULE_SHIPPING_FLATCANADA_TEXT_WAY', 'Best Way');
    ?>


    // $Id: flatcanada.php 1969 2005-09-13 06:57:21Z drbyte $
    //

    define('MODULE_SHIPPING_FLATCANADA_TEXT_TITLE', 'Regular Ground Shipping within Continental US (See Policies)<br>');
    define('MODULE_SHIPPING_FLATCANADA_TEXT_DESCRIPTION', 'Flat Rate');
    define('MODULE_SHIPPING_FLATCANADA_TEXT_WAY', 'Ground Shipping in Continental US. on orders under $175 - Approx. 10-15 Business Days from when the manufacturer ships to us. Less if we have it in our own stock. Free shipping is available within continental US on orders over $175 and international orders over $350.');
    ?>

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

    Default Re: Clone Flat Rate Shipping with Zone

    Do both of your files start with:
    <?php

    What does the language file have in it, you posted two different things ...

    What is the exact error you see?

    If I use your files, using the one set of the language defines and adding the missing:
    <?php

    to the tops of the files ... I am not getting errors ...
    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!

  7. #17
    Join Date
    Jan 2009
    Posts
    84
    Plugin Contributions
    0

    Default Re: Clone Flat Rate Shipping with Zone

    Yes, <?php is at the top of the files above the zencart info. I included the code for both includes/languages/english/modules/shipping AND includes/languages/english/modules/cambridge_pro/shipping. Like I said, I am always under the assumption that the file(s) in the customer folders are the ones being read. I did try uploading the files to the default folder first (error message in admin) and then uploaded it to the customer folder as well, still error message in admin. The error message in the admin is "WARNING: YOU HAVE DUPLICATE SORT ORDERS WHICH WILL RESULT IN CALCULATION ERRORS PLEASE CORRECT THESE ISSUES NOW! "

    But when I go in to edit the shipping module, now on the list in the admin after uploading the flatcanada files, it does not recognize the click on the Action button. It does show the setup in the box to the right (see screenshots above) but the sort in the box says 4. I can edit this sort but it does not update the sort order in the modules list (again see above which shows NO sort order). Editing the module in the admin appears to have no effect. And "Removing" it in the admin has no effect. Only is removed when I delete the files.

    I owe you a "cup of coffee!"
    Last edited by nfallat; 29 Jul 2012 at 04:39 AM.

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

    Default Re: Clone Flat Rate Shipping with Zone

    Go to your Tools ... Install SQL Patches ... and enter:
    delete FROM configuration WHERE configuration_key LIKE '%flatcanada%';

    Now go to the Modules ... Shipping ...

    1 do you see the flatcanada uninstalled?

    2 do you see all of the shipping modules listed and the blue panel on the right?

    3 do you see any error messages?
    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!

  9. #19
    Join Date
    Jan 2009
    Posts
    84
    Plugin Contributions
    0

    Default Re: Clone Flat Rate Shipping with Zone

    I inserted your patch and it did NOT uninstall the flatcanada module BUT error message is gone and I was able to successfully click on the Action button, set up the cost and sort order and update.

    The flatcanada shipping option is now available at checkout, if Canadian shipping address is used, which is what I was wanting.

    So, I think it is finally working. Your patch seems to have worked!

    I really appreciate all of your efforts, not only on this, but all over the forum where you seem to be very active on many issues.

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

    Default Re: Clone Flat Rate Shipping with Zone

    Just to be sure ...

    I would go to the Modules ... Shipping ... and see if the REMOVE and INSTALL work on your Flat Canada 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!

 

 
Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. v151 Flat Rate Shipping Clone with added code won't progress to the payment page
    By mrudden in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 15 Jan 2015, 06:25 PM
  2. v151 Free shipping only for 1 Zone - everywhere else Flat Rate
    By tpeck in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 8 Apr 2014, 01:39 PM
  3. v150 Flat Rate Shipping Clone
    By laurelsstitchery in forum Built-in Shipping and Payment Modules
    Replies: 7
    Last Post: 22 Feb 2012, 02:02 AM
  4. zone specific flat rate shipping question
    By Lockerroom in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 7 Jan 2010, 07:21 PM
  5. Shipping zone and flat rate for different products
    By janicekap in forum Built-in Shipping and Payment Modules
    Replies: 7
    Last Post: 21 Sep 2009, 09:35 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