Results 1 to 4 of 4
  1. #1
    Join Date
    May 2009
    Location
    Sydney
    Posts
    6
    Plugin Contributions
    0

    Default Building a custom module

    Hi, i am using 1.3.8a

    I am building a new module:

    filename: moto_detail_auspost.php
    class name: moto_detail_auspost

    constructor is initializing the MODULE_SHIPPING_AUSPOST_TEXT_TITLE, MODULE_SHIPPING_AUSPOST_TEXT_DESCRIPTION, MODULE_SHIPPING_AUSPOST_SORT_ORDER, MODULE_SHIPPING_AUSPOST_TAX_CLASS and MODULE_SHIPPING_AUSPOST_TAX_BASIS

    return true

    function quote is returning $this->quotes; which is correctly filled

    function check() returns True like in DB

    function install and remove looks OK

    Price calculation is good but on checkout process i am stuck on Step 1 of 3 - Delivery Information. If i choose FLAT rate or something else, is moving to step 2.

    Class/Zone rates are identical.

    What is the problem?

  2. #2
    Join Date
    May 2009
    Location
    Sydney
    Posts
    6
    Plugin Contributions
    0

    Default Re: Building a custom module

    Fixed:

    in /modules/pages/checkout_shipping/header_php.php:

    139: list($module, $method) = explode('_', $_SESSION['shipping']);

    My module was named moto_detail_auspost. I had to remove the "_" from module class name to work properly.

    But to find this... I've spent a few hours with various debug techniques to see variables and....

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

    Default Re: Building a custom module

    Thanks for the update and posting the cause and solution to this problem ...
    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!

  4. #4
    Join Date
    May 2009
    Location
    Sydney
    Posts
    6
    Plugin Contributions
    0

    Default Re: Building a custom module

    Tnx,

    i've been using:

    function logMe($var)
    {

    $filename = 'log.txt';
    if (!$handle = fopen($filename, 'a')) {
    echo "Cannot open file ($filename)";
    return;
    }
    $toSave = var_export($var, true);
    fwrite($handle, "[" . date("y-m-d H:i:s") . "]");
    fwrite($handle, "\n");
    fwrite($handle, $toSave);
    fwrite($handle, "\n");
    fclose($handle);
    }

    Is not mine, but a good tool to debug!

    The output is something like:

    [09-06-11 20:49:40]
    array (
    0 =>
    array (
    'id' => 'motodetailauspost',
    'module' => 'Australia Post',
    'methods' =>
    array (
    0 =>
    array (
    'id' => 'motodetailauspost',
    'title' => 'Registed post parcel >>>',
    'cost' => 5.4,
    ),
    ),
    ),
    )

 

 

Similar Threads

  1. Building Shipping Module Question
    By skrillnet in forum Addon Shipping Modules
    Replies: 8
    Last Post: 14 Jun 2012, 03:52 AM
  2. Replies: 2
    Last Post: 24 Apr 2012, 07:03 PM
  3. Help building/cloning Shipping module for API
    By danstever in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 29 Feb 2008, 04:17 PM
  4. Building a custom site
    By eaglerock in forum Templates, Stylesheets, Page Layout
    Replies: 13
    Last Post: 5 Nov 2007, 12:29 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