CatDadRick
Archived-
Posts
253 -
Joined
-
Last visited
Everything posted by CatDadRick
-
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? 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
-
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
-
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
-
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
-
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('[email protected]','UPS response',$body,'From: <[email protected]>'); */ // 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
-
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
-
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
-
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
-
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'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... 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
-
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
-
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... When I try to access the shopping cart I get a blank box and this error in my error.log... 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
-
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... 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
-
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
-
BlueCollarGuy, Moonlitsun, Thanks for the replies. I stopped following this several months ago, I guess I have a lot of reading ahead of me! 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?
-
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
-
Credit Class/Gift Vouchers/Discount Coupons 5.10
CatDadRick replied to Strider's topic in General Add-Ons Support
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 -
Credit Class/Gift Vouchers/Discount Coupons 5.10
CatDadRick replied to Strider's topic in General Add-Ons Support
I'm not a php expert, but I think you have some duplicate code here. I would start by removing one of these... Good luck. Rick Knight -
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
-
Credit Class/Gift Vouchers/Discount Coupons 5.10
CatDadRick replied to Strider's topic in General Add-Ons Support
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 -
OK. I've searched this thread but I can't find any mention of this problem... Step 6 if the install.txt says 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
-
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
-
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
-
Automatically send data feed to Froogle
CatDadRick replied to gottaloveit's topic in General Support
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 -
NEW! Complete Order Editing Tool!
CatDadRick replied to jhilgeman's topic in General Add-Ons Support
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