Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2011
    Posts
    2
    Plugin Contributions
    0

    Default Need help, a shipping module form OSC

    Dear all;

    Sorry to bother you, I found a shipping module (T-Cat express) from Taiwan's oscommerce, i try to convert to zen cart code, but system always display
    Fatal error: Call to a member function on a non-object in /home/httpd/vhosts/g-life.tw/httpdocs/includes/modules/shipping/tcat.php on line 82

    the code is
    PHP Code:
    $check_query zen_db_query("select configuration_value from " TABLE_CONFIGURATION " where configuration_key = 'MODULE_SHIPPING_TCAT_STATUS'"); 
    and i don't know how to do that can make it work

    this module is very useful in Taiwan, because T-Cat express is the largest express delivery company in Taiwan, and i hope someone can help me to fix this.

    finaly, if this module can work, i'll upload it for anyone need this shipping module, thanks.

    PHP Code:
    <?php
    /*
      $Id: tcat.php,v 1.1 2003/10/19 08:27:22 nickle Exp $

      osCommerce, Open Source E-Commerce Solutions
      http://www.oscommerce.com

      Copyright (c) 2003 osCommerce

      Released under the GNU General Public License
    */

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

    // class constructor
        
    function tcat() {
          global 
    $order;

          
    $this->code 'tcat';
          
    $this->title MODULE_SHIPPING_TCAT_TEXT_TITLE;
          
    $this->description MODULE_SHIPPING_TCAT_TEXT_DESCRIPTION;
          
    $this->sort_order MODULE_SHIPPING_TCAT_SORT_ORDER;
          
    $this->icon DIR_WS_ICONS 'tcat.gif';
          
    $this->tax_class MODULE_SHIPPING_TCAT_TAX_CLASS;
          
    $this->enabled = ((MODULE_SHIPPING_TCAT_STATUS == 'True') ? true false);
          if ( (
    $this->enabled == true) && ((int)MODULE_SHIPPING_TCAT_ZONE 0) ) {

            
    $check_flag false;
            
    $check_query zen_db_query("select zone_id from " TABLE_ZONES_TO_GEO_ZONES " where geo_zone_id = '" MODULE_SHIPPING_TCAT_ZONE "' and zone_country_id = '" $order->delivery['country']['id'] . "' order by zone_id");
            while (
    $check zen_db_fetch_array($check_query)) {
              if (
    $check['zone_id'] < 1) {
                
    $check_flag true;
                break;
              } elseif (
    $check['zone_id'] == $order->delivery['zone_id']) {
                
    $check_flag true;
                break;
              }
            }

            if (
    $check_flag == false) {
              
    $this->enabled false;
            }
          }

          
    $this->types = array('TIME0'=>'上午送達 08:00-12:00',
                               
    'TIME1'=>'下午送達 12:00-17:00',
                               
    'TIME2'=>'夜間送達 17:00-20:00'
                               
    );
     }
    // class methods
        
    function quote($method '') {
          global 
    $_POST$order$total_count;
          
    $this->quotes = array('id' => $this->code,
                                
    'module' => MODULE_SHIPPING_TCAT_TEXT_TITLE);
            
    $methods = array();
            if (
    $method) {
                
    $i substr($method,strlen($method)-1) ;
                    
    $methods[] = array('id' => 'TIME'.$i,
                                     
    'title' => $this->types['TIME'.$i],
                                     
    'cost' => MODULE_SHIPPING_TCAT_COST MODULE_SHIPPING_TCAT_HANDLING);
            } else {
                
    $qsize sizeof($this->types);
                for (
    $i=0$i<$qsize$i++) {
                  
    //list($type, $time) = each($this->types[$i]);
                  
    $methods[] = array('id' => 'TIME'.$i,
                                     
    'title' => $this->types['TIME'.$i],
                                     
    'cost' => MODULE_SHIPPING_TCAT_COST MODULE_SHIPPING_TCAT_HANDLING);
                }
            }
            
    $this->quotes['methods'] = $methods;

          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() {
          if (!isset(
    $this->_check)) {
            
    $check_query zen_db_query("select configuration_value from " TABLE_CONFIGURATION " where configuration_key = 'MODULE_SHIPPING_TCAT_STATUS'");
            
    $this->_check zen_db_num_rows($check_query);
          }
          return 
    $this->_check;
        }

        function 
    install() {
          
    zen_db_query("insert into " TABLE_CONFIGURATION " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('啟動宅急便模組?', 'MODULE_SHIPPING_TCAT_STATUS', 'True', '確定要啟動宅急便模組?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
          
    zen_db_query("insert into " TABLE_CONFIGURATION " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('運費', 'MODULE_SHIPPING_TCAT_COST', '120', '宅急便不分縣市每件統一收費', '6', '0', now())");
          
    zen_db_query("insert into " TABLE_CONFIGURATION " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('處理費', 'MODULE_SHIPPING_TCAT_HANDLING', '40', '宅急便每件處理費用', '6', '0', now())");
          
    zen_db_query("insert into " TABLE_CONFIGURATION " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('稅別', 'MODULE_SHIPPING_TCAT_TAX_CLASS', '0', '使用下列稅別', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
          
    zen_db_query("insert into " TABLE_CONFIGURATION " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('運送地區', 'MODULE_SHIPPING_TCAT_ZONE', '0', '如果選擇地區,則只有該地區可以使用這個運送模組', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
          
    zen_db_query("insert into " TABLE_CONFIGURATION " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('顯示順序', 'MODULE_SHIPPING_TCAT_SORT_ORDER', '0', '顯示順序,數字越小順序在前', '6', '0', now())");
        }

        function 
    remove() {
          
    zen_db_query("delete from " TABLE_CONFIGURATION " where configuration_key in ('" implode("', '"$this->keys()) . "')");
        }

        function 
    keys() {
          return array(
    'MODULE_SHIPPING_TCAT_STATUS''MODULE_SHIPPING_TCAT_COST''MODULE_SHIPPING_TCAT_HANDLING''MODULE_SHIPPING_TCAT_TAX_CLASS''MODULE_SHIPPING_TCAT_ZONE''MODULE_SHIPPING_TCAT_SORT_ORDER');
        }
      }
    ?>

  2. #2
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Need help, a shipping module form OSC

    Quote Originally Posted by G-Life.tw View Post
    Sorry to bother you, I found a shipping module (T-Cat express) from Taiwan's oscommerce, i try to convert to zen cart code, but system always display
    Fatal error: Call to a member function on a non-object in /home/httpd/vhosts/g-life.tw/httpdocs/includes/modules/shipping/tcat.php on line 82
    Check the wiki:

    http://www.zen-cart.com/wiki/index.p...dules_from_osC

    Cheers
    Rod

  3. #3
    Join Date
    Mar 2011
    Posts
    2
    Plugin Contributions
    0

    Default Re: Need help, a shipping module form OSC

    Quote Originally Posted by RodG View Post
    Is that your answer?
    I can tell you that i've been compare those code, but it still cannot work, so i ask for help from this community.
    but your answer seems that you think i didn't try even...................i'm so sad.

    OK, I'm so stupid and no logic to do this, i give up.

  4. #4
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,021
    Plugin Contributions
    3

    Default Re: Need help, a shipping module form OSC

    No one said you were stupid, but you're asking for someone to program a mod for you, and most of us don't have that skill.

  5. #5
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Need help, a shipping module form OSC

    Quote Originally Posted by G-Life.tw View Post
    Is that your answer?
    Hmmm, well, yes... Someone has taken a lot of care in writing that wiki, I really don't think I could have given you a better response if I tried.

    Well, I *suppose* I could download and debug your code for you and let you know what I find, and in all seriousness I might have considered doing so, but your response indicates that this would be a thankless task so I've now lost interest.

    Bye
    Rod

 

 

Similar Threads

  1. v151 Convert osC Payment module Atos for PHP5.3 into Zen cart - Need Help
    By xav2 in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 2 Dec 2013, 09:18 AM
  2. v151 Old OSC db Backup Need help converting
    By jbginz in forum General Questions
    Replies: 1
    Last Post: 26 Aug 2013, 08:46 PM
  3. Help with a osc converted shipping module
    By FrilansReklam in forum Addon Shipping Modules
    Replies: 2
    Last Post: 3 Sep 2010, 02:32 AM
  4. Need immediate help for displaying product fields in tabular form(cell form)
    By Madhu in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 26 Jan 2009, 01:00 PM
  5. shipping module convert from osc help
    By FrilansReklam in forum Addon Shipping Modules
    Replies: 0
    Last Post: 8 Oct 2008, 06:38 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