Jump to content

CatDadRick

Members
  • Content count

    253
  • Joined

  • Last visited

Posts posted by CatDadRick


  1. Craig,

     

    I've run into a problem. Hope you can point me in the right direction. I've got all the new MVS code integrated into my shop, found a couple of typos and corrected them. Everything looks right, except in checkout. Your new shipping modules are not being called. The shipping info is still being pulled from the standard shipping modules. Can you tell me where the new shipping modules are called?

     

    The ship modules that are included are the only ones available at this point. Each module needs fairly heavy modification in order to function with this system.

    I use a diferrent USPS module than what you've modified for MVS, so I'm going to be poking around in it some today to see if I can get it to work with MVS. I'll let you knw if I have any good results.

     

    Thanks again,

    Rick Knight


  2. Finally. A week and a half after your release, and I finally have time to test it. Looks great so far. I've been able to get this new MVS integrated into my heavily modded test store without too much trouble. In fact the only problem so far is in ~/catalog/admin/categories.php, in adding a new product or modifying an existing item, the vendor name list box shows up and contains my vendor list, but the vendor name is not added to the products table. I have not yet looked at the additions to categories.php for typos, I'll be doing that tonight.

     

    Also, can I put any shipping module into the new modules directory or do the modules needs some editing for this contrib? Do I need to remove the standard shipping modules in favor of the modules in the new location?

     

    Excellent work so far.

     

    Thanks,

    Rick Knight


  3. Hi Rick

     

    I would urge you to wait on moving this to your live site. We have been discussing the future of this mod, and it looks like a (nearly) complete rewrite is in the works.

    Jim,

     

    Thanks for the update and warning. I guess I'll hold off a bit.

     

    Can you post some more information? Like what's prompted the re-write, any progress yet, what direction you're going in and maybe what other mods might be involved. And, I have to ask, any files?

     

    Thanks,

    Rick Knight


  4. Your on track Rick. Exactly what we will be doing once we resolve a few other issues. If you have not yet installed Vendor Auto Email, you should look into, we will be using that as the basis for the Vendor management, and that will be where we get the "origin zip" and other ship info. Good work so far, Craig :)

    Craig, I just pm'd you but I'll post here also.

     

    I found the problem. In my catalog/admin/categories.php I have this...

    /* Re-Post all POST'ed variables */
         reset($HTTP_POST_VARS);
         while (list($key, $value) = each($HTTP_POST_VARS)) {
           if (!is_array($HTTP_POST_VARS[$key])) {
             echo tep_draw_hidden_field($key, htmlspecialchars(stripslashes($value)));
           } else {
             while (list($k, $v) = each($value)) {
               echo tep_draw_hidden_field($key . '[' . $k . ']', htmlspecialchars(stripslashes($v)));
             }
           }
         }
         $languages = tep_get_languages();
         for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
           echo tep_draw_hidden_field('products_name[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_name[$languages[$i]['id']])));
           echo tep_draw_hidden_field('products_description[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_description[$languages[$i]['id']])));
           echo tep_draw_hidden_field('products_url[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_url[$languages[$i]['id']])));
         }

    The /catalog/admin/categories.php from this mod has this...

    /* Re-Post all POST'ed variables */
         reset($HTTP_POST_VARS);
         while (list($key, $value) = each($HTTP_POST_VARS)) {
           if (!is_array($HTTP_POST_VARS[$key])) {
             echo tep_draw_hidden_field($key, htmlspecialchars(stripslashes($value)));
           }
         }
         $languages = tep_get_languages();
         for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
           echo tep_draw_hidden_field('products_name[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_name[$languages[$i]['id']])));
           echo tep_draw_hidden_field('products_description[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_description[$languages[$i]['id']])));
           echo tep_draw_hidden_field('products_url[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_url[$languages[$i]['id']])));
         }

    Apparently the }else{ statement kills the shipping methods array. I'm goin to look at a stock OSC install and see if the else statement is there or not, but for now, this gets everything in this new Multi Vendor Shipping contrib working for me on my very heavily modded site. I'm going to be doing a bunch of off-line testing and if things keep on working, I'll move this to my live site this weekend.

     

    I'll also take a look at the Auto Vendor email contrib. Right now I'm using the Enhanced Vendors contrib and it works except that it doesn't tie to the products DB very well. I was going to fix that, but I'll look at the one mentioned first.

     

    Thanks,

    Rick Knight


  5. I've been playing with this on one of my offline stores and trying to get shipping FROM multiple zip codes to work and I think I've come up with a workable solution. I'm not totally sure where your'e going with this mod, but I hope it's in a similar direction.

     

    What I've been trying to do, and just this morning succeeded at, was getting my shipping modules, ups and usps, to allow me to "hard code" the origin zip code and then install the module multiple times. The trick turned out to be modifying the class, the install and remove functions and a couple of other functions and then saving the modified module with a new, unique name. Then modifying the appropriate language file and saving it with the same name (in the languages directory). This creates a new shipping module which can then be installed in admin, modules, shipping. This may be a bit crude, but it does seem to work in conjunction with this Multi Vendor Shipping module. What would be great would be to have a single shipping module look at the vendors database to get it's zip code, but that is beyond me.

     

    Here's one of modified shipping modules and it's language file... (my changes are marked with "Changes for Tampa shipping origin - RWK)

    <?php
    /*
    $Id: ups.php,v 1.54 2003/04/08 23:23:42 dgw_ Exp $
    
     osCommerce, Open Source E-Commerce Solutions
     http://www.oscommerce.com
    
     Copyright (c) 2003 osCommerce
    
     Released under the GNU General Public License
    */
    
    /*
    revised by Fritz Clapp as UPS Choice 1.8 2003/08/02
     filters service types to those selected in admin and saved in 
     configuration table with key MODULE_SHIPPING_UPSTAMPA_TYPES;
     suggests STD service as default for Canada;
     modified error message refers to failure to get quote;
    
    */
    
    // Changed for Tampa shipping origin - RWK
    //  class ups {
     class upstampa {
       var $code, $title, $descrption, $icon, $enabled, $types;
    
    // class constructor
    // Changed for Tampa shipping origin - RWK
    //    function ups() {
       function upstampa() {
         global $order;
      
    // Changed for Tampa shipping origin RWK
    //      $this->code = 'ups';
    //      $this->title = MODULE_SHIPPING_UPS_TEXT_TITLE;
    //      $this->description = MODULE_SHIPPING_UPS_TEXT_DESCRIPTION;
    //      $this->sort_order = MODULE_SHIPPING_UPS_SORT_ORDER;
    //      $this->icon = DIR_WS_ICONS . 'shipping_ups.gif';
    //      $this->tax_class = MODULE_SHIPPING_UPS_TAX_CLASS;
    //      $this->enabled = ((MODULE_SHIPPING_UPS_STATUS == 'True') ? true : false);
         
      $this->code = 'upstampa';
         $this->title = MODULE_SHIPPING_UPSTAMPA_TEXT_TITLE;
         $this->description = MODULE_SHIPPING_UPSTAMPA_TEXT_DESCRIPTION;
         $this->sort_order = MODULE_SHIPPING_UPSTAMPA_SORT_ORDER;
         $this->icon = DIR_WS_ICONS . 'shipping_ups.gif';
         $this->tax_class = MODULE_SHIPPING_UPSTAMPA_TAX_CLASS;
         $this->enabled = ((MODULE_SHIPPING_UPSTAMPA_STATUS == 'True') ? true : false);
    
    // Changed for Tampa shipping origin RWK
    //      if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_UPS_ZONE > 0) ) {
         if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_UPSTAMPA_ZONE > 0) ) {
           $check_flag = false;
           $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_UPSTAMPA_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
           while ($check = tep_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('1DM' => 'Next Day Air Early AM',
                              '1DML' => 'Next Day Air Early AM Letter',
                              '1DA' => 'Next Day Air',
                              '1DAL' => 'Next Day Air Letter',
                              '1DAPI' => 'Next Day Air Intra (Puerto Rico)',
                              '1DP' => 'Next Day Air Saver',
                              '1DPL' => 'Next Day Air Saver Letter',
                              '2DM' => '2nd Day Air AM',
                              '2DML' => '2nd Day Air AM Letter',
                              '2DA' => '2nd Day Air',
                              '2DAL' => '2nd Day Air Letter',
                              '3DS' => '3 Day Select',
                              'GND' => 'Ground',
                              'GNDCOM' => 'Ground Commercial',
                              'GNDRES' => 'Ground Residential',
                              'STD' => 'Canada Standard',
                              'XPR' => 'Worldwide Express',
                              'XPRL' => 'worldwide Express Letter',
                              'XDM' => 'Worldwide Express Plus',
                              'XDML' => 'Worldwide Express Plus Letter',
                              'XPD' => 'Worldwide Expedited');
       }
    
    // class methods
       function quote($method = '') {
         global $HTTP_POST_VARS, $order, $shipping_weight, $shipping_num_boxes;
    
         if ( (tep_not_null($method)) && (isset($this->types[$method])) ) {
           $prod = $method;
    // BOF: UPS USPS
         } else if ($order->delivery['country']['iso_code_2'] == 'CA') {
        $prod = 'STD';
    // EOF: UPS USPS
         } else {
           $prod = 'GNDRES';
         }
    
         if ($method) $this->_upsAction('3'); // return a single quote
    
         $this->_upsProduct($prod);
    
         $country_name = tep_get_countries(SHIPPING_ORIGIN_COUNTRY, true);
    // Changed for Tampa shipping origin - RWK
    //      $this->_upsOrigin(SHIPPING_ORIGIN_ZIP, $country_name['countries_iso_code_2']);
    //      $this->_upsDest($order->delivery['postcode'], $order->delivery['country']['iso_code_2']);
    //      $this->_upsRate(MODULE_SHIPPING_UPSPICKUP);
    //      $this->_upsContainer(MODULE_SHIPPING_UPS_PACKAGE);
    //      $this->_upsWeight($shipping_weight);
    //      $this->_upsRescom(MODULE_SHIPPING_UPS_RES);
         $this->_upsOrigin(SHIPPING_ORIGIN_ZIP_TAMPA, $country_name['countries_iso_code_2']);
         $this->_upsDest($order->delivery['postcode'], $order->delivery['country']['iso_code_2']);
         $this->_upsRate(MODULE_SHIPPING_UPSTAMPA_PICKUP);
         $this->_upsContainer(MODULE_SHIPPING_UPSTAMPA_PACKAGE);
         $this->_upsWeight($shipping_weight);
         $this->_upsRescom(MODULE_SHIPPING_UPSTAMPA_RES);
         $upsQuote = $this->_upsGetQuote();
    
         if ( (is_array($upsQuote)) && (sizeof($upsQuote) > 0) ) {
           $this->quotes = array('id' => $this->code,
                                 'module' => $this->title . ' (' . $shipping_num_boxes . ' x ' . $shipping_weight . 'lbs)');
    
           $methods = array();
    // BOF: UPS USPS
    // Changed for Tampa shipping origin - RWK
    //  $allowed_methods = explode(", ", MODULE_SHIPPING_UPS_TYPES);
     $allowed_methods = explode(", ", MODULE_SHIPPING_UPSTAMPA_TYPES);
     $std_rcd = false;
    // EOF: UPS USPS
           $qsize = sizeof($upsQuote);
           for ($i=0; $i<$qsize; $i++) {
             list($type, $cost) = each($upsQuote[$i]);
    // BOF: UPS USPS
       if ($type=='STD') {
        if ($std_rcd) continue;
        else $std_rcd = true;
    	 };
       if (!in_array($type, $allowed_methods)) continue;
    // EOF: UPS USPS
             $methods[] = array('id' => $type,
                                'title' => $this->types[$type],
    // Changed for Tampa shipping origin - RWK
    //                             'cost' => ($cost + MODULE_SHIPPING_UPS_HANDLING) * $shipping_num_boxes);
                                'cost' => ($cost + MODULE_SHIPPING_UPSTAMPA_HANDLING) * $shipping_num_boxes);
           }
    
           $this->quotes['methods'] = $methods;
    
           if ($this->tax_class > 0) {
             $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
           }
         } else {
    /* ORIGINAL
           $this->quotes = array('module' => $this->title,
                                 'error' => 'An error occured with the UPS shipping calculations.<br>' . $upsQuote . '<br>If you prefer to use UPS as your shipping method, please contact the store owner.');
    */
    // BOF: UPS USPS
           $this->quotes = array('module' => $this->title,
                                 'error' => 'We are unable to obtain a rate quote for UPS shipping.<br>Please contact the store if no other alternative is shown.');
    // EOF: UPS USPS
         }
    
         if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);
    
         return $this->quotes;
       }
    
    /* Changed for Tampa shipping origin    
    function check() {
         if (!isset($this->_check)) {
           $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_UPS_STATUS'");
           $this->_check = tep_db_num_rows($check_query);
         }
         return $this->_check;
       }
    
       function install() {
         tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable UPS Shipping', 'MODULE_SHIPPING_UPS_STATUS', 'True', 'Do you want to offer UPS shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
         tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('UPS Pickup Method', 'MODULE_SHIPPING_UPS_PICKUP', 'CC', 'How do you give packages to UPS? CC - Customer Counter, RDP - Daily Pickup, OTP - One Time Pickup, LC - Letter Center, OCA - On Call Air', '6', '0', now())");
         tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('UPS Packaging?', 'MODULE_SHIPPING_UPS_PACKAGE', 'CP', 'CP - Your Packaging, ULE - UPS Letter, UT - UPS Tube, UBE - UPS Express Box', '6', '0', now())");
         tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Residential Delivery?', 'MODULE_SHIPPING_UPS_RES', 'RES', 'Quote for Residential (RES) or Commercial Delivery (COM)', '6', '0', now())");
         tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_UPS_HANDLING', '0', 'Handling fee for this shipping method.', '6', '0', now())");
         tep_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 ('Tax Class', 'MODULE_SHIPPING_UPS_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
         tep_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 ('Shipping Zone', 'MODULE_SHIPPING_UPS_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
         tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_SHIPPING_UPS_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
    // BOF: UPS USPS
         tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ( 'Shipping Methods', 'MODULE_SHIPPING_UPS_TYPES', 'Nxt AM,Nxt AM Ltr,Nxt,Nxt Ltr,Nxt PR,Nxt Save,Nxt Save Ltr,2nd AM,2nd AM Ltr,2nd,2nd Ltr,3 Day Select,Ground,Canada,World Xp,World Xp Ltr, World Xp Plus,World Xp Plus Ltr,World Expedite', 'Select the USPS services to be offered.', '6', '13', 'tep_cfg_select_multioption(array(\'1DM\',\'1DML\', \'1DA\', \'1DAL\', \'1DAPI\', \'1DP\', \'1DPL\', \'2DM\', \'2DML\', \'2DA\', \'2DAL\', \'3DS\',\'GND\', \'STD\', \'XPR\', \'XPRL\', \'XDM\', \'XDML\', \'XPD\'), ', now() )");
    // EOF: UPS USPS
       }
    
       function remove() {
         tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
       }
    
       function keys() {
    // BOF: UPS USPS
         return array('MODULE_SHIPPING_UPS_STATUS', 'MODULE_SHIPPING_UPS_PICKUP', 'MODULE_SHIPPING_UPS_PACKAGE', 'MODULE_SHIPPING_UPS_RES', 'MODULE_SHIPPING_UPS_HANDLING', 'MODULE_SHIPPING_UPS_TAX_CLASS', 'MODULE_SHIPPING_UPS_ZONE', 'MODULE_SHIPPING_UPS_SORT_ORDER', 'MODULE_SHIPPING_UPS_TYPES');
    // EOF: UPS USPS
    End of Changes for Tampa shipping origin */    
    
    function check() {
         if (!isset($this->_check)) {
           $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_UPSTAMPA_STATUS'");
           $this->_check = tep_db_num_rows($check_query);
         }
         return $this->_check;
       }
    
       function install() {
         tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable UPS Shipping', 'MODULE_SHIPPING_UPSTAMPA_STATUS', 'True', 'Do you want to offer UPS shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
         tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('UPS Pickup Method', 'MODULE_SHIPPING_UPSTAMPA_PICKUP', 'CC', 'How do you give packages to UPS? CC - Customer Counter, RDP - Daily Pickup, OTP - One Time Pickup, LC - Letter Center, OCA - On Call Air', '6', '0', now())");
         tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('UPS Packaging?', 'MODULE_SHIPPING_UPSTAMPA_PACKAGE', 'CP', 'CP - Your Packaging, ULE - UPS Letter, UT - UPS Tube, UBE - UPS Express Box', '6', '0', now())");
         tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Residential Delivery?', 'MODULE_SHIPPING_UPSTAMPA_RES', 'RES', 'Quote for Residential (RES) or Commercial Delivery (COM)', '6', '0', now())");
         tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_UPSTAMPA_HANDLING', '0', 'Handling fee for this shipping method.', '6', '0', now())");
         tep_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 ('Tax Class', 'MODULE_SHIPPING_UPSTAMPA_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
         tep_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 ('Shipping Zone', 'MODULE_SHIPPING_UPSTAMPA_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
         tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_SHIPPING_UPSTAMPA_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
    // BOF: UPS USPS
         tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ( 'Shipping Methods', 'MODULE_SHIPPING_UPSTAMPA_TYPES', 'Nxt AM,Nxt AM Ltr,Nxt,Nxt Ltr,Nxt PR,Nxt Save,Nxt Save Ltr,2nd AM,2nd AM Ltr,2nd,2nd Ltr,3 Day Select,Ground,Canada,World Xp,World Xp Ltr, World Xp Plus,World Xp Plus Ltr,World Expedite', 'Select the USPS services to be offered.', '6', '13', 'tep_cfg_select_multioption(array(\'1DM\',\'1DML\', \'1DA\', \'1DAL\', \'1DAPI\', \'1DP\', \'1DPL\', \'2DM\', \'2DML\', \'2DA\', \'2DAL\', \'3DS\',\'GND\', \'STD\', \'XPR\', \'XPRL\', \'XDM\', \'XDML\', \'XPD\'), ', now() )");
    // EOF: UPS USPS
       }
    
       function remove() {
         tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
       }
    
       function keys() {
    // BOF: UPS USPS
         return array('MODULE_SHIPPING_UPSTAMPA_STATUS', 'MODULE_SHIPPING_UPSTAMPA_PICKUP', 'MODULE_SHIPPING_UPSTAMPA_PACKAGE', 'MODULE_SHIPPING_UPSTAMPA_RES', 'MODULE_SHIPPING_UPSTAMPA_HANDLING', 'MODULE_SHIPPING_UPSTAMPA_TAX_CLASS', 'MODULE_SHIPPING_UPSTAMPA_ZONE', 'MODULE_SHIPPING_UPSTAMPA_SORT_ORDER', 'MODULE_SHIPPING_UPSTAMPA_TYPES');
    // EOF: UPS USPS
       }
    
       function _upsProduct($prod){
         $this->_upsProductCode = $prod;
       }
    
       function _upsOrigin($postal, $country){
         $this->_upsOriginPostalCode = $postal;
         $this->_upsOriginCountryCode = $country;
       }
    
       function _upsDest($postal, $country){
         $postal = str_replace(' ', '', $postal);
    
         if ($country == 'US') {
           $this->_upsDestPostalCode = substr($postal, 0, 5);
         } else {
           $this->_upsDestPostalCode = $postal;
         }
    
         $this->_upsDestCountryCode = $country;
       }
    
       function _upsRate($foo) {
         switch ($foo) {
           case 'RDP':
             $this->_upsRateCode = 'Regular+Daily+Pickup';
             break;
           case 'OCA':
             $this->_upsRateCode = 'On+Call+Air';
             break;
           case 'OTP':
             $this->_upsRateCode = 'One+Time+Pickup';
             break;
           case 'LC':
             $this->_upsRateCode = 'Letter+Center';
             break;
           case 'CC':
             $this->_upsRateCode = 'Customer+Counter';
             break;
         }
       }
    
       function _upsContainer($foo) {
         switch ($foo) {
           case 'CP': // Customer Packaging
             $this->_upsContainerCode = '00';
             break;
           case 'ULE': // UPS Letter Envelope
             $this->_upsContainerCode = '01';
             break;
           case 'UT': // UPS Tube
             $this->_upsContainerCode = '03';
             break;
           case 'UEB': // UPS Express Box
             $this->_upsContainerCode = '21';
             break;
           case 'UW25': // UPS Worldwide 25 kilo
             $this->_upsContainerCode = '24';
             break;
           case 'UW10': // UPS Worldwide 10 kilo
             $this->_upsContainerCode = '25';
             break;
         }
       }
    
       function _upsWeight($foo) {
         $this->_upsPackageWeight = $foo;
       }
    
       function _upsRescom($foo) {
         switch ($foo) {
           case 'RES': // Residential Address
             $this->_upsResComCode = '1';
             break;
           case 'COM': // Commercial Address
             $this->_upsResComCode = '2';
             break;
         }
       }
    
       function _upsAction($action) {
         /* 3 - Single Quote
            4 - All Available Quotes */
    
         $this->_upsActionCode = $action;
       }
    
       function _upsGetQuote() {
         if (!isset($this->_upsActionCode)) $this->_upsActionCode = '4';
    
         $request = join('&', array('accept_UPS_license_agreement=yes',
                                    '10_action=' . $this->_upsActionCode,
                                    '13_product=' . $this->_upsProductCode,
                                    '14_origCountry=' . $this->_upsOriginCountryCode,
                                    '15_origPostal=' . $this->_upsOriginPostalCode,
                                    '19_destPostal=' . $this->_upsDestPostalCode,
                                    '22_destCountry=' . $this->_upsDestCountryCode,
                                    '23_weight=' . $this->_upsPackageWeight,
                                    '47_rate_chart=' . $this->_upsRateCode,
                                    '48_container=' . $this->_upsContainerCode,
                                    '49_residential=' . $this->_upsResComCode));
         $http = new httpClient();
         if ($http->Connect('www.ups.com', 80)) {
           $http->addHeader('Host', 'www.ups.com');
           $http->addHeader('User-Agent', 'osCommerce');
           $http->addHeader('Connection', 'Close');
    
           if ($http->Get('/using/services/rave/qcostcgi.cgi?' . $request)) $body = $http->getBody();
    
           $http->Disconnect();
         } else {
           return 'error';
         }
    
    // BOF: UPS USPS
    /*
    TAMPA by checking out in the catalog; try a variety of shipping destinations to be sure
    your customers will be properly served.  If you are not getting any quotes, try enabling
    more alternatives in admin. Make sure your store's postal code is set in Admin ->
    Configuration -> Shipping/Packaging, since you won't get any quotes unless there is
    a origin that UPS recognizes.
    
    If you STILL don't get any quotes, here is a way to find out exactly what UPS is sending
    back in response to rate quote request.  At line 278, you will find this statement in a
    comment block: 
    
       mail('you@yourdomain.com','UPS response',$body,'From: <you@yourdomain.com>');
    */
    // EOF: UPS USPS
    
         $body_array = explode("\n", $body);
    
         $returnval = array();
         $errorret = 'error'; // only return error if NO rates returned
    
         $n = sizeof($body_array);
         for ($i=0; $i<$n; $i++) {
           $result = explode('%', $body_array[$i]);
           $errcode = substr($result[0], -1);
           switch ($errcode) {
             case 3:
               if (is_array($returnval)) $returnval[] = array($result[1] => $result[8]);
               break;
             case 4:
               if (is_array($returnval)) $returnval[] = array($result[1] => $result[8]);
               break;
             case 5:
               $errorret = $result[1];
               break;
             case 6:
               if (is_array($returnval)) $returnval[] = array($result[3] => $result[10]);
               break;
           }
         }
         if (empty($returnval)) $returnval = $errorret;
    
         return $returnval;
       }
     }
    ?>

    I moved the origin zipcode to this file...

    <?php
    /*
     $Id: ups.php,v 1.5 2002/11/19 01:48:08 dgw_ Exp $
    
     osCommerce, Open Source E-Commerce Solutions
     http://www.oscommerce.com
    
     Copyright (c) 2002 osCommerce
    
     Released under the GNU General Public License
    */
    
    define('MODULE_SHIPPING_UPSTAMPA_TEXT_TITLE', 'United Parcel Service - Tampa');
    define('MODULE_SHIPPING_UPSTAMPA_TEXT_DESCRIPTION', 'United Parcel Service - Tampa');
    define('MODULE_SHIPPING_UPSTAMPA_TEXT_OPT_GND', 'UPS Ground');
    define('MODULE_SHIPPING_UPSTAMPA_TEXT_OPT_1DM', 'Next Day Air Early AM');
    define('MODULE_SHIPPING_UPSTAMPA_TEXT_OPT_1DA', 'Next Day Air');
    define('MODULE_SHIPPING_UPSTAMPA_TEXT_OPT_1DP', 'Next Day Air Saver');
    define('MODULE_SHIPPING_UPSTAMPA_TEXT_OPT_2DM', '2nd Day Air Early AM');
    define('MODULE_SHIPPING_UPSTAMPA_TEXT_OPT_3DS', '3 Day Select');
    define('MODULE_SHIPPING_UPSTAMPA_TEXT_OPT_STD', 'Canada Standard');
    define('MODULE_SHIPPING_UPSTAMPA_TEXT_OPT_XPR', 'Worldwide Express');
    define('MODULE_SHIPPING_UPSTAMPA_TEXT_OPT_XDM', 'Worldwide Express Plus');
    define('MODULE_SHIPPING_UPSTAMPA_TEXT_OPT_XPD', 'Worldwide Expedited');
    define('SHIPPING_ORIGIN_ZIP_TAMPA', '33610');
    ?>

    Now, I just need to solve a problem I have with the shipping_method array in catalog/admin/categories.php.

     

    Thanks,

    Rick Knight


  6. Thanks for the replies. I guess I wasn't clear in what I'm looking for. WHat I want to know is, where in the code, not configuration, do the shipping modules get the Zipcode information. I've looked at the shipping modules and I can't find where they're getting the Zipcode information.

     

    Thanks,

    Rick Knight


  7. Can someone tell me, where do the shipping modules get the ship from zip codes? I'm thinking of some mods, but I can't locate where each shipping module is getting it's zip code "ship from" information.

     

    Thanks,

    Rick Knight


  8. Jim,

     

    All instances of that have been removed or commented out. Something in my code is calling it but I can't pin it down. Is there a way to trace what the code is doing? So that I can see where it's being called?

     

    Thanks,

    Rick Knight

    Jim,

     

    I found what is/was calling shipping.php, catalog/includes/modules/shipping_estimator.php and catalog/checkout_paypalipn.php. I'm notusing that paypalipn module and I can live without the shipping estimator if needed.

     

    I also found the other error I was having with shopping_cart.php. I missed this when I merged your code with my shopping_cart.php...

    $product_query = tep_db_query("select products_id, products_price, products_tax_class_id, products_weight, products_ship_method " . $new_fields . " from " . TABLE_PRODUCTS . " where products_id='" . (int)$products_id . "'");

    Now, back to the ship_methods array in catalog/admin/categories.php.

     

    Thanks,

    Rick Knight


  9. includes/classes/shipping.php should not even be called. Look through your code for
    require(DIR_WS_CLASSES . 'shipping.php');

    and comment it out. It should be in the top section of the page where you are getting the errors.

    Jim,

     

    All instances of that have been removed or commented out. Something in my code is calling it but I can't pin it down. Is there a way to trace what the code is doing? So that I can see where it's being called?

     

    Thanks,

    Rick Knight


  10. Jim,

     

    I've been able to successfully merge your shopping_cart.php with mine and I've corrected all the "undefined function" errors. I'm now able to access my cart with either your files or mine, but now I've run into another problem...

    I'm getting this in my error.log...

    PHP Fatal error:  Unsupported operand types in /usr/local/httpd/catalog/includes/classes/shipping.php on line 71
    This is the code the error is referring to...
            if (SHIPPING_BOX_WEIGHT >= $shipping_weight*SHIPPING_BOX_PADDING/100) {
             $shipping_weight = $shipping_weight+SHIPPING_BOX_WEIGHT;
           } else {
             $shipping_weight = $shipping_weight + ($shipping_weight*SHIPPING_BOX_PADDING/100);
           }

    I can't see a problem with the code but, but I'm not a coder. If you have time, could you take a look?

     

    Thanks,

    Rick Knight


  11. Jim,

     

    I found the undefined function. It was one of my other contribs, not sure how I overlooked it.

     

    Using your catalog/includes/classes/shopping_cart.php and adding a couple of functions I needed for other mods, I was able to get it working. I was able to go all the way through checkout! Now I need to get it to work starting with my code and adding in the Multiship bits.

     

    Also, I have not been able to get the array to work correctly in catalog/admin/categories.php. I know it's the way I'm trying to add your new code. When I add new product to my catalog, I get the new shipping method list box, but the shipping method I choose is not inserted into the products table, instead I get the word "Array" no matter what method I've chosen when adding the product. If I manually add the ship method to the table with phpMyAdmin, checkout works fine. I'm not entirely sure what the code in my admin/categories is doing, so I'm not sure just how to make the changes and what I have tried to do hasn't worked. Here's the code, if anyone can take a look and make suggestions?

     

    Your code...

    tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model,products_image, products_price, products_date_added, products_date_available, products_weight, products_ship_method, products_status, products_tax_class_id, manufacturers_id) values ('" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_price']) . "',  now(), '" . tep_db_input($product['products_date_available']) . "', '" . tep_db_input($product['products_weight']) . "', '" . tep_db_input($product['products_ship_method']) . "', '0', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['manufacturers_id'] . "')");

    My code...

                tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model, products_vendor_sku, products_ship_method, products_image"
                 . $new_fields_mo_pics
                 . ", products_price, products_cost, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id"
                 . $new_fields
                 . ")
                 values ('" . $product['products_quantity'] . "', '" . $product['products_model'] . "', '" . $product['products_vendor_sku'] . "', '" . $product['products_ship_method'] . "', '" . $product['products_image']
                 . "', '" . $product['products_bimage'] . "',  '" . $product['products_subimage1'] . "',  '" . $product['products_bsubimage1'] . "',  '" . $product['products_subimage2'] . "',  '" . $product['products_bsubimage2'] . "',  '" . $product['products_subimage3'] . "',  '" . $product['products_bsubimage3'] . "',  '" . $product['products_subimage4'] . "',  '" . $product['products_bsubimage4'] . "',  '" . $product['products_subimage5'] . "',  '" . $product['products_bsubimage5'] . "',  '" . $product['products_subimage6'] . "',  '" . $product['products_bsubimage6']
                 . "', '" . $product['products_price'] . "', '" . $product['products_cost'] . "', now(), '" . $product['products_date_available'] . "', '" . $product['products_weight'] . "', '0', '" . $product['products_tax_class_id'] . "', '" . $product['manufacturers_id']
                 . "', '" . $product['products_price_list']  . "', '" . $product['products_price_rebate'] . "', '" . $product['products_quantity_order_min'] . "', '" . $product['products_quantity_order_units']
                 . "', '" . $product['products_discount1'] . "', '" . $product['products_discount2'] . "', '" . $product['products_discount3'] . "', '" . $product['products_discount4'] . "', '" . $product['products_discount1_qty'] . "', '" . $product['products_discount2_qty'] . "', '" . $product['products_discount3_qty'] . "', '" . $product['products_discount4_qty']
                 . "', '" . $product['product_is_free'] . "', '" . $product['product_is_call'] . "', '" . $product['product_is_showroom_only'] . "', '" . $product['products_priced_by_attribute'] . "', '" . $product['products_quantity_mixed'] . "', '" . $product['products_discount_percentage'] . "', '" . $product['products_price_excluded']
                . "')");

    Also, I added

    define('TEXT_PRODUCTS', 'Products: '):

    to catalog/includes/languages/english.php

     

    Thanks,

    Rick Knight


  12. Jim,

     

    I think I found another one. I added the new file, catalog/includes/shopping_cart.php, and ran into another problem. When go to checkout I get a blank screen and this error in my server error.log...

    PHP Fatal error:  Call to undefined function: in_cart_mixed() in /usr/local/httpd/catalog/includes/verify_shopping_cart.php on line 38

    When I try to access the shopping cart I get a blank box and this error in my error.log...

    PHP Fatal error:  Call to undefined function: in_cart_mixed() in /usr/local/httpd/catalog/includes/classes/order.php on line 305

    I've verified that function in_cart_mixed is not defined on my system, but I can't tell just where it's being called.

     

    Thanks,

    Rick Knight


  13. Looks like you may be missing a file somewhere. This happens when the old Shipping class is used. That class has been replaced with includes/functions/shipping.php, at least until I get time to rewrite the Shipping class. Which page do you get the error on? That's probably the one that needs to be changed.

    Jim,

     

    I was getting the error on "catalog/checkout_shipping.php", but I found the error earlier this morning. I had an extra

    require(DIR_WS_CLASSES . 'shipping.php');

    in my "catalog/checkout_shipping.php.

     

    Now I get the checkout dialog, but without the shipping method box, just the title "Shipping Method" and then the comments box. If I continue with checkout, everything works except there is no charge for shipping. In my shopping cart I can get shipping estimates, so I know my shipping modules are being read at some point. In my server error log I get this error everytime I access checkout_shipping...

     

    PHP Warning:  Invalid argument supplied for foreach() in /usr/local/httpd/catalog/checkout_shipping.php on line 372
    Line 372 is equivalent to line 257 in your checkout_shipping.php and contains...
    // Loop through the quotes for each shipping method
     foreach ($shipping_weight as $shipping_method => $weight) {

    I know, I do have other contribs installed, but I get this error with either your checkout_shipping.php or with mine. That doesn't seem to make any difference.

     

    Thanks,

    Rick Knight


  14. Jim,

     

    I'm getting this error when I go to checkout...

     

    "PHP Fatal error: Cannot redeclare class table in /usr/local/httpd/catalog/includes/modules/shipping/table.php on line 13".

     

    Line 13 in ~/table.php reads...

     

    "class table {"

     

    I've used grep to find another instance of "class table {" but there isn't one so I don't know why I'm getting this error. Could it be bug 2?

     

    Thanks

    Rick Knight


  15. BlueCollarGuy, Moonlitsun,

     

    Thanks for the replies. I stopped following this several months ago, I guess I have a lot of reading ahead of me!

     

    Take a look at the code Chemo put up and see what you get. Hopefully things will move quickly from here. Jim's work seems to have created a bit of a breakthrough so hopefully we will have more progress soon. Stay tuned! Craig :)

    Chemo,

     

    I downloaded and installed this today and, of course, ran into problems. I have a very heavily modded site and my test sites are also equally heavily modded so I tried to pull the new code from the files in the contribution and I'm sure I made a typo somewhere. I'm going to try again tonight and tomorrow, but I have a couple of questions, should I remove the earlier MVS contribution? And second, more of a request, is it possible to put together a real short "here's what needs to be copied" document?


  16. BlueCollarGuy,

     

    I have been waiting sooooo loooong for this. I have had MVS on my live store in one form or another for several months, maybe a year. And while it does work, it is VERY limited. Last I heard Tahuti and MoonLitSun were working on privately, but I haven't heard anything from either of them in several months and really thought they had given up on the project. I can't tell you how happy I am that you're working on this.

     

    I have two test stores in addition to my live store and I'm going to download and install your code and see waht happens. I'm no coder, but I'll do whatever I can to help this project move forward.

     

    Thanks

    Rick Knight


  17. Strider, Mibble, Anna, Anyone?

     

    I thought I had this contrib working flawlessly, until I read Anna's message about $credit_covers. I had somehow overlooked that in my testing. Everything is working except that when the credit covers the total purchase, the customer is still taken through the payment section of the checkout process and the invoice indicates the default payment method instead of no payment method. This is very confusing to customers, so I need to find a fix.

     

    I've applied the changes Anna recomended and I've checked for the pre_confirmation_check in catalog/includes/classes/order_total.php and it looks like everything is there, but it just acts like $credit_covers is not being set true.

     

    Any ideas what may be causing this and how I might fix it?

     

    Thanks,

    Rick Knight


  18. Installation of the 5.11 package has gone pretty smooth.  The one problem I'm having is that my shopping cart box is displaying the products twice.  (If a customer has a gv amount, that amount is only displayed once)  Here's a screen shot:

     

        if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {

            $cart_contents_string .= '<span class="newItemInCart">';

          } else {

            $cart_contents_string .= '<span class="infoBoxContentsRed2">';

          }

     

          $cart_contents_string .= $products[$i]['quantity'] . ' x </span></td><td valign="top" class="infoBoxContentsRed2"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';

     

          if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {

            $cart_contents_string .= '<span class="newItemInCart">';

          } else {

            $cart_contents_string .= '<span class="infoBoxContentsRed2">';

          }

    I'm not a php expert, but I think you have some duplicate code here. I would start by removing one of these...

        if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {

            $cart_contents_string .= '<span class="newItemInCart">';

          } else {

            $cart_contents_string .= '<span class="infoBoxContentsRed2">';

          }

    Good luck.

     

    Rick Knight


  19. I have an old version of Easy Populate, 2.6.2 I think, and I want to replace it with the newest version. When I installed the older version I had to set "register_globals = on" in my php.ini file to get it to work. Does EP still need register globals? Or can I turn it off after I've installed the new version?

     

    Thanks,

    Rick Knight


  20. Hi All,

     

    I've just been reminded of this (thanks Mibble!) and as it seems I might not be the only person that gets it, I thought I'd share the (easy!) solution:

    Anna,

     

    I've had CCGV working for some time, but I had never checked for this error. Sure enough, Im also getting it. I applied your fixes, but they don't seem to do anything for me, no fix but also no additional errors, which makes me think that the fix may be working but $credit_covers is allways empty. Is that possible? Where does $credit_covers value come from?

     

    Thanks,

    Rick Knight


  21. OK. I've searched this thread but I can't find any mention of this problem...

     

    Step 6 if the install.txt says

    Step 6. Order the Drop Down options by the "sort_order" field in the /catalog/product_info.php file.

            This will display the options in the drop down list in the order that they were assigned

            when they were created/modified.

           

            **HINT**: In a fresh copy of osCommerce's /catalog/product_info.php page, look at line 132 for this

            query.

           

    ******** 6.1a: I changed this query:

           

           

    $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");   

     

    The problem is, I don't have a "$products_options_query" or anything quite like it in catalog/product_info.php.

     

    I'm running a heavily modded OSC 2.2MS2 with SEC, but as far as I know, it is MS2.2.

     

    How can I get this installed?

     

    Thanks

    RickKnight


  22. you should use the authorizenet with curl

     

    i found decent rates at of all places, Costco . .

    Mibble,

     

    Great tip. I never would have thought to look at Costco. I just got off the phone with a NOVA/Costco rep and it looks like a pretty good deal. I have one question thought that he couldn't answer. How much additional is the Authorize.net gateway? Do you know? Have you signed on with the Csotco provider and did they get you setup with Authorize.net?

     

    Thanks,

    Rick Knight


  23. The cancellation fee is from Wells Fargo.

    I confirmed this fee with them.

     

    I still haven't decided but will be doing so by week's end.

    Any other recommendations out there?

     

    I've just spent some time chatting (on-line) with a MerchantPlus.com Exec V P. They use Authorize.net and their fees seem OK. $7.95 for the Authorize.net gateway and a $9.95 statement fee Plus $25.00 monthly minimum charges for the merchant account (JPMogan Chase). They can also act as the merchant account and save you $10.00 a month. They also have a cancellation fee, $295 if you cancel in the first 12 months.

     

    Does this sound good? Can anyone recomend anyone cheaper? Any bad news about MerchantPlus.com?

     

    Thanks,

    Rick Knight


  24. This is outrageous.... and very discouraging. some person keeps harassing me via e-mail about the Froogle Data Feeder. She claims it's a scam. I created this to give back to the osC community.... I agree some users have difficulties installing the Froogle Data Feeder, but none the less the code is provided free and comes with a fairly easy installation instructions.

     

    Calvin,

     

    Regardless of what the poster claims, I think you have put out a great, and COMPLETE, contribution and I thank you for it.

     

    Thanks,

    Rick Knight


  25. I installed a very early version of this contribution several months ago and it worked OK. Today I upgraded to 1.60 and now I'm getting an error...

    I don't have table "orders_ship_method" in my database and I can't find any info in this contrib about that table. Where does it get created?

     

    Thanks,

    Rick Knight

     

    OK, I found the answer to this problem. Now I'm having another problem, the edit order screen is blank. My log files show that file menu.js cannot be found. Where can I get menu.js?

     

    Thanks again,

    Rick Knight

×