Page 1 of 6 123 ... LastLast
Results 1 to 10 of 55
  1. #1

    Default Adding 2 more flat rate shipping modules

    I need the flat rate shipping module 2 more times so that customers can chose between:-

    Before 10am delivery
    before noon delivery
    Before 5:30 pm delivery

    Is there a way to do this?

  2. #2
    Join Date
    Mar 2008
    Location
    Cape Town & London (depends on the season)
    Posts
    2,975
    Plugin Contributions
    0

    Default Re: Adding 2 more flat rate shipping modules

    You can create CLONES (copies) of the FLAT module. This duplicates the functions of the module, but enables more than one Flat Rate module to operate.

    Essentially you need to do this:

    1. On your home computer, create TWO folders:

    • flatone
    • flattwo


    In each of these folders, create the following directory trees:

    includes\modules\shipping\
    includes\languages\english\modules\shipping\

    So you now have a Zencart-compatible directory structure for each of the TWO new modules you are about to create.

    • flatone\includes\modules\shipping\
    • |- - - - - - - - - - -\languages\english\modules\shipping\
    • flattwo\includes\modules\shipping\
    • |- - - - - - - - - - -\languages\english\modules\shipping\


    You should have a copy of your zencart software on your home computer, so make copies of the relevant "flat.php" files, (but if not, you can FTP the files) -: (FIRST to the respective folders in flatone, then again to the respective folders in flattwo)

    includes\modules\shipping\flat.php
    includes\languages\english\modules\shipping\flat.php

    The point here is to get two SETS of identical files of the original FLAT module, into the right directory structure on your hard drive.

    (NB: BOTH of these files are called "flat.php", but they are different! One is the MODULE file, and the other is the LANGUAGE file. You must make sure the correct file goes to the correct directory!)

    When you have all the copied files in the right place, you can start the clone process:

    Go to your folder called flatone.

    Navigate in turn, to the two "flat.php" files and RE-NAME both of them "flatone.php"

    (Do the same with the "flat.php" files in the directory tree in flattwo - this time, you call the "flat.php" files "flattwo.php".)

    • flatone\includes\modules\shipping\flatone.php (module file)
    • |- - - - - - - - - - -\languages\english\modules\shipping\flatone.php (language file)
    • flattwo\includes\modules\shipping\flattwo.php (module file)
    • |- - - - - - - - - - -\languages\english\modules\shipping\flattwo.php (language file)


    Now you need to EDIT each file. And it's quite simple...

    Open:

    flatone\includes\modules\shipping\flatone.php (module file)

    Currently, it will look like this (first few lines):

    PHP Code:
    <?php
    //
    // +----------------------------------------------------------------------+
    // |zen-cart Open Source E-commerce                                       |
    // +----------------------------------------------------------------------+
    // | Copyright (c) 2004 The zen-cart developers                           |
    // |                                                                      |
    // | http://www.zen-cart.com/index.php                                    |
    // |                                                                      |
    // | Portions Copyright (c) 2003 osCommerce                               |
    // +----------------------------------------------------------------------+
    // | This source file is subject to version 2.0 of the GPL license,       |
    // | that is bundled with this package in the file LICENSE, and is        |
    // | available through the world-wide-web at the following url:           |
    // | http://www.zen-cart.com/license/2_0.txt.                             |
    // | If you did not receive a copy of the zen-cart license and are unable |
    // | to obtain it through the world-wide-web, please send a note to       |
    // | [email protected] so we can mail you a copy immediately.          |
    // +----------------------------------------------------------------------+
    // $Id: flat.php 1969 2005-09-13 06:57:21Z drbyte $
    //

      
    class flat {
        var 
    $code$title$description$icon$enabled;

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

          
    $this->code 'flat';
          
    $this->title MODULE_SHIPPING_FLAT_TEXT_TITLE;
          
    $this->description MODULE_SHIPPING_FLAT_TEXT_DESCRIPTION;








          
    $this->sort_order MODULE_SHIPPING_FLAT_SORT_ORDER;
          
    $this->icon '';
          
    $this->tax_class MODULE_SHIPPING_FLAT_TAX_CLASS;
          
    $this->tax_basis MODULE_SHIPPING_FLAT_TAX_BASIS;
    Now, you will see as you read through the file, the words:

    flat
    and
    FLAT
    appear...

    Make sure to keep lower and uppercase when they appear, change instances of:-

    flat to flatone
    and
    FLAT to FLATONE

    So you will have, for example (first couple of lines here):

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

     
    class flatone {
        var 
    $code$title$description$icon$enabled;

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

          
    $this->code 'flatone';
          
    $this->title MODULE_SHIPPING_FLATONE_TEXT_TITLE
    ... see how instances of flat and FLAT become flatone and FLATONE ?

    When you have changed all instances, SAVE the file.

    Now you need to edit the corresponding LANGUAGE FILE.

    So, on your hard drive, open the following:

    flatone\includes\languages\english\modules\shipping\flatone.php

    This will have the following code:

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

    define('MODULE_SHIPPING_FLAT_TEXT_TITLE''Flat Rate');
    define('MODULE_SHIPPING_FLAT_TEXT_DESCRIPTION''Flat Rate');
    define('MODULE_SHIPPING_FLAT_TEXT_WAY''Best Way');
    ?> 
    Now you do the same here with flat and FLAT

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

    define('MODULE_SHIPPING_FLATONE_TEXT_TITLE''Flat Rate ONE');
    define('MODULE_SHIPPING_FLATONE_TEXT_DESCRIPTION''Flat Rate ONE');
    define('MODULE_SHIPPING_FLATONE_TEXT_WAY''Best Way FLAT RATE ONE');
    ?> 
    (Naturally, you will also change the defines to suit your needs - I have just given them a quick label to help identify them later).

    SAVE the file.

    ------------------------------------------------------------------

    NOW... you duplicate the process for flattwo

    ------------------------------------------------------------------

    When you have completed your edits, you now FTP the files to your server. You can choose to use your custom over-ride folders to house the new files, or leave them in their default directories - as there is no core file called "flatone.php" it will not be overwritten in a future upgrade.

    Please note that on your hard drive you have ROOT folders called:

    flatone
    and
    flattwo

    These folders are NOT FTP'd - Just the contents of their INCLUDES folders. (So you are conforming to the directory structure of ZC).

    ------------------------------------------------------------------

    Now, go to your ADMIN CONSOLE and navigate to the shipping modules.

    You will now see - in addition to the flat module, you have:

    flatone
    flattwo

    If you have been sensible and given your language defines appropriate labels, you will see these modules properly labelled.

    Install, configure and use the modules.
    Last edited by fairestcape; 16 Dec 2008 at 01:33 PM.

  3. #3

    Default Re: Adding 2 more flat rate shipping modules

    That worked perfect fairestcape. thanks

  4. #4
    Join Date
    Jul 2005
    Location
    Brisbane
    Posts
    8
    Plugin Contributions
    0

    Default Re: Adding 2 more flat rate shipping modules

    Hi

    Thanks for the great step by step!

    I have a quick question. When I change the names from flat to flatone etc and then go to the shipping modules in admin the main name is still Flat Rate. So now I have two modules called Flat Rate ie. I want one to remain Flat Rate and the other to be known as Parcel Post. How do I change the name from flat rate to whatever I want it to be?

    Thanks for your assistance.

    Megan

  5. #5
    Join Date
    Jul 2005
    Location
    Brisbane
    Posts
    8
    Plugin Contributions
    0

    Default Re: Adding 2 more flat rate shipping modules

    Hi

    I managed to find where this is located in the flat.php file. I just need to play around now and get the shipping to do what I want it to do ;)

    Thanks for your initial guide as it was a really great help.

    Megan

  6. #6

    Default Re: Adding 2 more flat rate shipping modules

    Thanks for the idiot-proof instructions.
    worked perfectly...... misasfashioncafe

    Robert

  7. #7
    Join Date
    Feb 2008
    Location
    Auckland, NZ
    Posts
    53
    Plugin Contributions
    0

    Default Re: Adding 2 more flat rate shipping modules

    Thanks heaps for this just what i needed :)

  8. #8
    Join Date
    May 2007
    Location
    Brighton/Hove/Sussex
    Posts
    144
    Plugin Contributions
    0

    Default Re: Adding 2 more flat rate shipping modules

    Quote Originally Posted by studiotucker View Post
    Thanks for the idiot-proof instructions.
    worked perfectly...... misasfashioncafe
    Robert
    Absolutely, found that a very simple set of instructions, so except for those programmers who really understand php workings unlike me for example, this sort of description helps those who like Zen-Cart without having to know how to write php code itself.
    The serious bit many could fall over is the copy of the whole folders in the root directory! Was a good reminder there.

    Ive just created FLATUK, FLATEU, FLATUS, FLATROW after Ive already got those four Zone Definitions set. What I needed was a fixed rate for each of the four as a customer bought from Brazil and used the UK flat rate fee! My mistake but fortunately was covered being lightweight items. FLAT RATE covers the low cost items, but over a set price you can allow for a UK post paid facility. However be mindful of the odd items that are really heavy, and spoil the FLAT RATE figures. Therefore I cannot discount those items with tight margins!
    Original store was 1.39:- TransportPostcards.co.uk/shop (redirecting out)
    Working on a fresh new store... 1.56a TransportPostcards.co.uk/store
    Appreciate Zen-Cart? - Always keep a banner link on your shop

  9. #9
    Join Date
    Mar 2008
    Location
    Cape Town & London (depends on the season)
    Posts
    2,975
    Plugin Contributions
    0

    Default Re: Adding 2 more flat rate shipping modules

    I'm glad people are finding this post helpful and useful.

    Many (though not all) of the shipping modules can be cloned in the same way. Examples of "clonable" shipping modules include:

    Flat Rate
    Zone Rates
    Table Rates

    ... and one in particular that I like in the Free Add-ons:

    ZoneTables.

    Just follow the principles outlined in my earlier post.

  10. #10
    Join Date
    Feb 2006
    Location
    Central Coast, NSW, Australia
    Posts
    560
    Plugin Contributions
    0

    Default Re: Adding 2 more flat rate shipping modules

    Quote Originally Posted by fairestcape View Post
    I'm glad people are finding this post helpful and useful.

    Many (though not all) of the shipping modules can be cloned in the same way. Examples of "clonable" shipping modules include:

    Flat Rate
    Zone Rates
    Table Rates

    ... and one in particular that I like in the Free Add-ons:

    ZoneTables.

    Just follow the principles outlined in my earlier post.
    Excellent walkthrus... Just one question.

    If I need to make 7 separate zones, for shipping across Australian States, would this be the process to use ?

 

 
Page 1 of 6 123 ... LastLast

Similar Threads

  1. flat rate shipping for three or more shippers
    By bigbear in forum Built-in Shipping and Payment Modules
    Replies: 18
    Last Post: 30 Oct 2010, 03:21 AM
  2. How Do I two flat rate shipping Modules
    By directdesign in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 13 Mar 2010, 05:26 AM
  3. More than one Flat Rate for Shipping
    By brightideas in forum Built-in Shipping and Payment Modules
    Replies: 6
    Last Post: 8 Mar 2010, 01:18 AM
  4. More Flat Rate Shipping Modules?
    By Checkit in forum Addon Shipping Modules
    Replies: 2
    Last Post: 26 Nov 2006, 09:13 AM
  5. Flat Rate and USPS Shipping Modules Conflict
    By eDigitalExpress in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 8 Sep 2006, 05:01 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