Jump to content
Latest News: (loading..)
fulluvscents

USPS Rate V4, Intl Rate V2 (official support thread)

Recommended Posts

Hi Jetta,

 

On the files that download there was not general.php to modify. only changed the categoreis.php files and uploaded the usps.php.

 

Where is this php?

Share this post


Link to post
Share on other sites

in searching for tep_cfg_usps_services. the line is on 325 of the USPS.php that was uploaded. I hope this helps you find out the problem. Thanks

Share this post


Link to post
Share on other sites

Please see my post #74 from earlier today. I have solved my error, I had not installed all files. However, I now get no USPS data on the checkout_shipping page, and clicking continue does not advance to the checkout_payment page.

 

Can anyone tell me if a new registration for the API RateV4 tools is needed? As I mentioned previously, I have a UserID from the older API tools. At this point I don't know if I have errors in my code, or simply need a new UserID.

 

Thank you.

Share this post


Link to post
Share on other sites

@@jeffreyice1

 

If the description is too long, try setting that to text as well. If that doesn't work, let me know.

 

@@rwest

 

I got the exact same error last night when installing the zencart USPS mod on a zen shop. I don't know what it was, but I clicked a few things in admin and made it go away. Not being my script, I wasn't going to mess with it. Now that I am aware that it's affecting this mod as well, I'll try to look into it and see what that is. If you change anything in admin to make it go away, would you post what changes you made, so it will help me pinpoint the source of the problem?

 

If it's not returning rates, make sure you've selected shipping options, and that you have your zip code set in your configuration settings. Those are the first things that pop to mind. And if that doesn't work, then find the line that is commented with the TEP_MAIL function. Uncomment it, run the cart for a test run, and see what gets sent to you in the email.

 

No need to upgrade your API username.

 

@@dculley

 

The function isn't defined, because the general.php file wasn't modified. It sounds like you installed one of the "add ons" for the mod, and not the mod itself. ADD-ON USPS restrict Methods by Product I uploaded the add ons to the same page because they ONLY work with that USPS mod. Sorry if it's confusing. The versions are in order of least to most options. At the bottom is a plain mod without extras. As you go higher, they get more "souped up". The highest full package is USPS Rate V4 Intl Rate V2 - v.1.7 - FIX

 

You can open any version, addon, or compatibility pack, for a description of that particular download.

Edited by fulluvscents

Share this post


Link to post
Share on other sites

Thank you, Jetta.

 

Well, I do have my zip configured for my store. I notice that after I edit and save the services, text gets stored in the min and max fields. Initially for 1st-Class Lg. Env min=0 max=70 and Handling=0.00. After saving this, and going back in, the values have now changed. min=First Class Mail max=0 and Handling=70. Also, the selection checks get cleared.

 

Thank you.

Share this post


Link to post
Share on other sites

You don't have a problem with the checkboxes working and everything else while you are in the panel, right? But, when you save it, it's not being saved correctly?

 

I know what's happening, but I don't know how to explain how to fix it. It's more of a hands on thing, and something I dealt with when putting this together, and resolved from what I saw.

 

Is the following code exactly what you have in your admin ....... general.php file?

 

function tep_cfg_usps_services($select_array, $key_value, $key = '')
{
   $key_values = explode( ", ", $key_value);
$name = (($key) ? 'configuration[' . $key . '][]' : 'configuration_value');
$string = '<b><div style="width:20px;float:left;text-align:center;"> </div><div style="width:30px;float:left;text-align:center;">Min</div><div style="width:30px;float:left;text-align:center;">Max</div><div style="float:left;"></div><div style="width:50px;float:right;text-align:center;">Handling</div></b><div style="clear:both;"></div>';
   for ($i=0; $i<sizeof($select_array); $i++)
 {
 $string .= '<div id="' . $key . $i . '">';
 $string .= '<div style="width:20px;float:left;text-align:center;">' . tep_draw_checkbox_field($name, $select_array[$i], (in_array($select_array[$i], $key_values) ? 'CHECKED' : '')) . '</div>';
 if (in_array($select_array[$i], $key_values)) next($key_values);
 $string .= '<div style="width:30px;float:left;text-align:center;">' . tep_draw_input_field($name, current($key_values), 'size="1"') . '</div>';
 next($key_values);
 $string .= '<div style="width:30px;float:left;text-align:center;">' . tep_draw_input_field($name, current($key_values), 'size="1"') . '</div>';
 next($key_values);
 $string .= '<div style="float:left;">' . preg_replace(array('/RM/', '/TM/', '/International/', '/Envelope/', '/ Mail/', '/Large/', '/Medium/', '/Small/', '/First/', '/Legal/', '/Padded/', '/Flat Rate/', '/Regional Rate/', '/Express Guaranteed /'), array('', '', 'Int\'l', 'Env', '', 'Lg.', 'Md.', 'Sm.', '1st', 'Leg.', 'Pad.', 'F/R', 'R/R', 'Exp Guar'), $select_array[$i]) . '</div>';
 $string .= '<div style="width:50px;float:right;text-align:center;">$' . tep_draw_input_field($name, current($key_values), 'size="2"') . '</div>';
 next($key_values);
 $string .= '<div style="clear:both;"></div></div>';
 }
   return $string;
}
function tep_cfg_usps_extraservices($select_array, $key_value, $key = '')
{
   $key_values = explode( ", ", $key_value);
$name = (($key) ? 'configuration[' . $key . '][]' : 'configuration_value');
$string = '<b><div style="width:20px;float:left;text-align:center;">N</div><div style="width:20px;float:left;text-align:center;">C</div><div style="width:20px;float:left;text-align:center;">S</div><div style="width:20px;float:left;text-align:center;">H</div></b><div style="clear:both;"></div>';
   for ($i=0; $i<sizeof($select_array); $i++)
 {
 $string .= tep_draw_hidden_field($name, $select_array[$i]);
 next($key_values);
 $string .= '<div id="' . $key . $i . '">';
 $string .= '<div style="width:20px;float:left;text-align:center;"><input type="checkbox" name="' . $name . '" value="N" ' . (current($key_values) == 'N' || current($key_values) == '' ? 'CHECKED' : '') . ' id="N" onClick="if($(this).is(\':checked\')) $(\'#C, #S, #H\', $(\'#' . $key . $i . '\')).removeAttr(\'checked\'); if($(\':checkbox:checked\', $(\'#' . $key . $i . '\')).size() == 0) $(this).attr(\'checked\', \'checked\');"></div>';
 $string .= '<div style="width:20px;float:left;text-align:center;"><input type="checkbox" name="' . $name . '" value="C" ' . (current($key_values) == 'C' ? 'CHECKED' : '') . ' id="C" onClick="if($(this).is(\':checked\')) $(\'#N, #S, #H\', $(\'#' . $key . $i . '\')).removeAttr(\'checked\'); if($(\':checkbox:checked\', $(\'#' . $key . $i . '\')).size() == 0) $(\'#N\', $(\'#' . $key . $i . '\')).attr(\'checked\', \'checked\');"></div>';
 $string .= '<div style="width:20px;float:left;text-align:center;"><input type="checkbox" name="' . $name . '" value="S" ' . (current($key_values) == 'S' ? 'CHECKED' : '') . ' id="S" onClick="if($(this).is(\':checked\')) $(\'#N, #C, #H\', $(\'#' . $key . $i . '\')).removeAttr(\'checked\'); if($(\':checkbox:checked\', $(\'#' . $key . $i . '\')).size() == 0) $(\'#N\', $(\'#' . $key . $i . '\')).attr(\'checked\', \'checked\');"></div>';
 $string .= '<div style="width:20px;float:left;text-align:center;"><input type="checkbox" name="' . $name . '" value="H" ' . (current($key_values) == 'H' ? 'CHECKED' : '') . ' id="H" onClick="if($(this).is(\':checked\')) $(\'#N, #C, #S\', $(\'#' . $key . $i . '\')).removeAttr(\'checked\'); if($(\':checkbox:checked\', $(\'#' . $key . $i . '\')).size() == 0) $(\'#N\', $(\'#' . $key . $i . '\')).attr(\'checked\', \'checked\');"></div>';
 next($key_values);
 $string .= preg_replace(array('/Signature/', '/without/', '/Merchandise/', '/TM/', '/RM/'), array('Sig', 'w/out', 'Merch.', '', ''), $select_array[$i]) . '<br>';
 $string .= '<div style="clear:both;"></div></div>';
 }
   return $string;
}

Share this post


Link to post
Share on other sites

This appears to be a popular contribution. I'm having zero luck. hopefully some help will be forthcoming. Installation was painless, no biggie. i obtained my usps username and password and configured the options.

 

the problem is when i go to check out. i don't see any USPS options. i only see my fedex module. no errors, just no USPS. i start with version 1.7 if it matters. my site is 2.3.1. the only addons i have are:

 

fedex: http://www.oscommerce.com/community/contributions,7977

 

Discount Coupon Codes 3.34 for osc 2.31: http://www.oscommerce.com/community/contributions,4269

 

any help would be much appreciated. i receive no errors.

 

i even tried copy over all of the files included in this contribution vs editing as i usually do. USPS shipping still doesn't show as an option.

 

help!

 

thank you

Share this post


Link to post
Share on other sites

Hi Jetta,

 

I went back and downloaded ver v.1.7_fix and installed. That took care of the first problem. But now I have 2 more little ones.

 

1 - in usps / edit under the "Sort order" box there is a blank with a box. not sure what to do there. Seems the heading for the box is missing. have attached a pic.

 

2 - the USPS logo and options are not showing up in checkout. What did I miss?

Share this post


Link to post
Share on other sites

in trying to fix the above, i went to the new add on, and uploaded the includes/modules/shipping/usps.php. it fixed the admin edit side. but now when i go to check out i get

1054 - Unknown column 'products_usps_restricted' in 'field list'

 

select products_usps_restricted from products where products_id = '78'

 

[TEP STOP]

Share this post


Link to post
Share on other sites

i just went to admin cat/prod and got this

1054 - Unknown column 'p.products_usps_restricted' in 'field list'

 

select pd.products_name, pd.products_description, pd.products_url, p.products_usps_restricted, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from products p, products_description pd where p.products_id = '78' and p.products_id = pd.products_id and pd.language_id = '1'

 

[TEP STOP]

Share this post


Link to post
Share on other sites

I am having the same issue as rwest. I have everything installed and working on the admin side, but the USPS pricing does not show up in checkout_shipping.php. I am running rc2.2.


If the only tool you have is a hammer, all your problems look like nails

Share this post


Link to post
Share on other sites

Hi Jetta,

 

Yes, almost. I don't have the line in function tep_cfg_usps_extraservices which begins with $string and contains the value="C".

Share this post


Link to post
Share on other sites

Jetta,

 

The code was missing the single line because that is how it is listed in the step-by-step instructions in the readme file for the general.php file. I have added the line, but it has no effect on the admin side. It still appears correct the first time I edit it, but the contents of the boxes get messed up. I am still not getting rates.

Edited by rwest

Share this post


Link to post
Share on other sites

@@dculley - the add on requires a small sql query. You'll need to perform that query in your database.

 

@@rwest & @@lyonsperf

If one of you (or both) wants to volunteer to let me into your shop so that I can hunt down the problem and solution, then PM me.

 

I could read back through the posts,but I'll just ask - are you both on 2.2 shops? I haven't been able to personally test one yet, and if I can get in, then I can find out what incompatibilities exist, and get those listed with the contribution.

Share this post


Link to post
Share on other sites

Hi Jetta

 

i went through from v1.1 to 1.7.1fix. I removed the latest add on that modified the catagories. I quess I will need to start putting them back. After I get the catagories modified I will need to add the line in sql.txt, (ALTER TABLE `products` ADD `products_usps_restricted` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL) is that right?

 

Also ( hate to be a dummy) I don't know how or where. Can you please point me in the direction I need to go and what to do?

 

Thanks for your help.

Dean

Share this post


Link to post
Share on other sites

Can anyone help me with the above sql query on how to add it and where?

 

Thanks

Share this post


Link to post
Share on other sites

o-my god, I did it. it is working no errors and it is wonderful. Took a stab at sql database. Hopefully it is right. Seem to be working.

 

Thanks

Share this post


Link to post
Share on other sites

I got to excited ran in to another problem. The usps is working and I evan loaded the free shipping and it is working. What has stopped working is the listings under Caterories. I have one the is call "Flags" under it is 17 sub cat's. But now you can click on flags and nothing happens. It will not open the or show the sub caterories.

 

What to do?

Share this post


Link to post
Share on other sites

Jetta, I have done that and its not solved by the length... Its something in the insert that is not right.. Like an extra ) or ' or some other character that is not right under windows version of 3.2.1... or mysql under windows!

Share this post


Link to post
Share on other sites

Hello,

 

Of course I found out at the last minute that the old version of the USPS API was turning off today (which broke USPS for me) and I scrambled today to get this fixed. I'm running a 2.2 store ( http://fuelinjectionent.com/webstore ).

 

I got the new module discussed here, followed the instructions and when I go to check out, I get a blank white page. If I turn off USPS in the admin tool, everything works again (except I only get United Parcel Service of course).

 

I've backed out of this twice and restored it to the original state...then tried it again. Same result each time. At least I'm consistent.

 

I skipped the jQuery thing in the instructions because A. I don't know how to do it and B. It says it won't work for 2.2 stores anyway. Could this be related? I turned off showing the international options and that didn't help.

 

Help! My store is very dependent on USPS. Anyone have ideas what I've done wrong or what I'm forgetting?

 

Thanks,

Spud

Share this post


Link to post
Share on other sites

One other thing I noticed...the old USPS stuff I used wanted the User ID and Password entered in the Admin section. This new stuff only shows a field for the User ID...not the password. Could this be related? Maybe because no password, the USPS site is returning an error and causing the blank white page?

 

Thanks for any clues. I could sure use one!

 

Spud

Share this post


Link to post
Share on other sites

Do not change your checkout_shipping.php file in 2.2. Make the required changes to usps.php in the includes/modules/shipping folder. Also add the changes to includes/application.top.

If you follow the readme manual instructions, do everything except the checkout_shipping changes.

Also make sure you remove the module in admin BEFORE changing the rest of the files. You also need to edit your locaton in the change in application_top.

The new api only uses your user name. The password has been discarded.


If the only tool you have is a hammer, all your problems look like nails

Share this post


Link to post
Share on other sites

Do not change your checkout_shipping.php file in 2.2. Make the required changes to usps.php in the includes/modules/shipping folder. Also add the changes to includes/application.top.

If you follow the readme manual instructions, do everything except the checkout_shipping changes.

Also make sure you remove the module in admin BEFORE changing the rest of the files. You also need to edit your locaton in the change in application_top.

The new api only uses your user name. The password has been discarded.

 

I did all as instructed...still get a blank white screen when I check out and checkout_shipping.php is called.

 

I have also tried with and without the supplied includes\languages\english\checkout_shipping.php in place and I get the same thing.

 

I replaced the usps.php in the includes/modules/shipping folder with the supplied one as it was completely different.

 

I removed and readded the module as directed and toggled a bunch of the configuration options hoping maybe something there was giving it a headache.

 

Has anyone with a 2.2 store got this to work? It sounds like it is untested with 2.2.

 

Thanks for the help...........anymore ideas for me? Currently hosed.

 

Spud

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×