2 replies [Last post]
keyone's picture
Offline
Joined: 10/01/2008
Juice: 95
Was this information Helpful?

I am running Drupal 5 and just upgraded from Ubercart 1.4 to 1.6. I have some products that are shippable, and some are not shippable. When I am checking out with a shippable product, everything works great. When I am checking out with a nonshippable product, there are problems since the upgrade. I have tried reverting to the old ubercart 1.4 files, but the error still occurs. More problem details below.

Thanks for any ideas (my head hurts from banging it against the wall all day!)

Problems when checking out with non-shippable product:
* does not compute any tax at all.
* you cannot input your credit card info, so you can't get past that screen. This is the biggest issue.
* I get the javascript error "s_f_name has no properties" in uc_taxes.js, more info below
* In the checkout page, there is am message saying Javascript must be enabled in the payment screen
* there is an extra text field at the bottom of the page in Firefox, and an extra State selection field in MSIE.

screenshot, firefox: http://i37.tinypic.com/2ce6m9u.jpg

From firefox console:
Error: s_f_name has no properties
Source File: https://www.justforcnas.com/sites/all/modules/ubercart/uc_taxes/uc_taxes...
Line: 76

PS: I tried switching to Garland theme, to no avail.

keyone's picture
Offline
Joined: 10/01/2008
Juice: 95
Re: s_f_name has no properties

Apparently, I did not revert to 1.4. I had renamed the 1.6 ubercart directory to "ubercart1.6.-bak12-08", then uploaded the 1.4 directory, then ran update.php with both directories in place. Drupal was smart enough to know which was the most recent one. Dang. I can't figure out how to revert. Any help? Basically, the not-shippable items do not work with version 1.6 because of this javascript error.

Update: I did figure out how to revert back to 1.4, yet the error remains. I am stumped Sad

keyone's picture
Offline
Joined: 10/01/2008
Juice: 95
Re: Re: s_f_name has no properties

I did figure something out by looking at the uc_cart.module code. There is a setting in the checkout configuration that tells the cart to hide shipping fields in checkout when the order is not shippable. In "Home » Administer » Store administration » Configuration" there is a checkbox for that. Unchecking that box got rid of the javascript error and is now computing tax. However, now I get an unfriendly error message that says shipping cannot be computed, and actually, you cannot proceed from that point. Bluh. More headbanging for carol.

Next step is to undo above, and then see if I can edit the uc_taxes.js to just set all those shipping fields to equal the billing fields.

Okay, I solved the problem by editing uc_taxes.js

Changed THIS near line 39

  var s_f_name = $("input[@name*=delivery_first_name]").val();
  if (!s_f_name) {
    s_f_name = '';
  }

TO THIS

  var s_f_name = $("input[@name*=delivery_first_name]").val();
  if (!s_f_name) {
    s_f_name  = $("input[@name*=billing_first_name]").val();
  } 
  if (!s_f_name) {
    s_f_name = '';
  }

Basically says that if the delivery first name doesn't exist, then set it equal to the billing first name. If still null, then set it equal to nothing. For some reason, the other delivery fields did not require this kludge.

There is still one annoyance. At the end of the checkout screen, there is a select box for state. This is for calculating taxes, but that is not clear to the customer, and I'm trying to figure out how to get rid of it, and just set delivery state = billing state if nonshippable. Will post if when I figure it out. See attached image for screenshot.

AttachmentSize
cwap.JPG 25.55 KB