Jump to content



Photo
* * * * * 1 votes

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


  • Please log in to reply
1316 replies to this topic

#81   fulluvscents

fulluvscents
  • Members
  • 305 posts
  • Real Name:Jetta
  • Gender:Female
  • Location:Fort Wayne, Indiana

Posted 31 March 2012 - 03:36

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;">&nbsp;</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;
}


#82   ndamico

ndamico
  • Members
  • 40 posts
  • Real Name:nick d

Posted 31 March 2012 - 08:03

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.oscommerc...tributions,7977

Discount Coupon Codes 3.34 for osc 2.31: http://www.oscommerc...tributions,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

#83   dculley

dculley
  • Members
  • 318 posts
  • Real Name:Dean Culley
  • Gender:Male
  • Location:North Charleston, SC (USA)

Posted 31 March 2012 - 15:12

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?

#84   dculley

dculley
  • Members
  • 318 posts
  • Real Name:Dean Culley
  • Gender:Male
  • Location:North Charleston, SC (USA)

Posted 31 March 2012 - 15:20

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]


#85   dculley

dculley
  • Members
  • 318 posts
  • Real Name:Dean Culley
  • Gender:Male
  • Location:North Charleston, SC (USA)

Posted 31 March 2012 - 15:21

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]


#86   lyonsperf

lyonsperf
  • Members
  • 333 posts
  • Real Name:Matt
  • Gender:Male
  • Location:CT

Posted 31 March 2012 - 17:07

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

#87   rwest

rwest
  • Members
  • 81 posts
  • Real Name:Ron West
  • Gender:Male
  • Location:WA

Posted 31 March 2012 - 19:18

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".

#88   rwest

rwest
  • Members
  • 81 posts
  • Real Name:Ron West
  • Gender:Male
  • Location:WA

Posted 31 March 2012 - 22:13

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, 31 March 2012 - 22:13.


#89   fulluvscents

fulluvscents
  • Members
  • 305 posts
  • Real Name:Jetta
  • Gender:Female
  • Location:Fort Wayne, Indiana

Posted 01 April 2012 - 01:56

@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.

#90   dculley

dculley
  • Members
  • 318 posts
  • Real Name:Dean Culley
  • Gender:Male
  • Location:North Charleston, SC (USA)

Posted 01 April 2012 - 02:11

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

#91   dculley

dculley
  • Members
  • 318 posts
  • Real Name:Dean Culley
  • Gender:Male
  • Location:North Charleston, SC (USA)

Posted 01 April 2012 - 03:08

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

Thanks

#92   dculley

dculley
  • Members
  • 318 posts
  • Real Name:Dean Culley
  • Gender:Male
  • Location:North Charleston, SC (USA)

Posted 01 April 2012 - 04:08

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

#93   dculley

dculley
  • Members
  • 318 posts
  • Real Name:Dean Culley
  • Gender:Male
  • Location:North Charleston, SC (USA)

Posted 01 April 2012 - 17:28

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?

#94   dculley

dculley
  • Members
  • 318 posts
  • Real Name:Dean Culley
  • Gender:Male
  • Location:North Charleston, SC (USA)

Posted 01 April 2012 - 17:30

Oh I'm also getting product not found.

#95   dculley

dculley
  • Members
  • 318 posts
  • Real Name:Dean Culley
  • Gender:Male
  • Location:North Charleston, SC (USA)

Posted 01 April 2012 - 18:02

Found it - fixed it. Scarry........ /ph34r.png' class='bbc_emoticon' alt=':ph34r:' />

#96   jeffreyice1

jeffreyice1
  • Members
  • 5 posts
  • Real Name:Jeffrey Ice

Posted 02 April 2012 - 03:29

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!

#97   fuelinjent

fuelinjent
  • Members
  • 7 posts
  • Real Name:Spud Miller

Posted 02 April 2012 - 04:58

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

#98   fuelinjent

fuelinjent
  • Members
  • 7 posts
  • Real Name:Spud Miller

Posted 02 April 2012 - 05:17

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

#99   lyonsperf

lyonsperf
  • Members
  • 333 posts
  • Real Name:Matt
  • Gender:Male
  • Location:CT

Posted 02 April 2012 - 12:10

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

#100   fuelinjent

fuelinjent
  • Members
  • 7 posts
  • Real Name:Spud Miller

Posted 02 April 2012 - 13:49

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