8 replies [Last post]
michels's picture
Offline
Uber DonorBug FinderInternationalizationizer
Joined: 08/12/2007
Juice: 205
Was this information Helpful?

Hi there.

I've been away from Ubercart since September, but when I see the Beta4 today I thought it's time to get up-to-date.
So I took a fresh Drupal Installation, downloaded Ubercart and its recommend modules and installed it. I really like your improvements - you did a great job!
But for me, the whole Shipping-Process doesn't work. I just activated the Shipping Quotes and the Flatrate Module and get a JS-Syntax error on the checkout page.

The following code produces the error

if (set_line_item != undefined){
set_line_item("shipping", "", , 1);
}

That seems for me to be generated in uc_quote.module, line 1246.

<?php
if (set_line_item != undefined){
 
set_line_item("shipping", "'. $method['quote']['accessorials'][$quote['accessorials']] .'", '. $quote['rate'] .', 1);
}
?>

$quote is the $_SESSION['quote']. But this is session is empty

    quote => Array
        (
            [method] =>
            [accessorials] =>
            [rate] =>
            [quote_form] =>
        )

While doing a bit more debugging hardcoded the line 1246 in uc_quote.module to something like that.

<?php
if (set_line_item != undefined){
 
set_line_item("shipping", "hey there", 10, 1);
}
?>

After that, the JS-Error now is
set_line_item is not defined

Any ideas?

TR
TR's picture
Offline
Bug FinderFAQ ModeratorGetting busy with the Ubercode.
Joined: 11/05/2007
Juice: 3424
Re: Beta 4: Problems with Shipping

What version of workflow-ng do you have installed?

Shipping quotes have changed quite a bit since Sept. Flat rate now doesn't have any configurations defined by default - you have to configure a flat rate at admin/store/settings/quotes/methods/flatrate before enabling. My guess is you have some stuff left around from your old installation that didn't get properly updated. I would disable and *uninstall* workflow-ng and flatrate, then install workflow-ng 1.6 and flatrate again.

<tr>.
michels's picture
Offline
Uber DonorBug FinderInternationalizationizer
Joined: 08/12/2007
Juice: 205
workflow-ng 1.6

I'm using a brand-new-installation of Drupal with nothing else than Ubercart on it. I'm using workflow-ng 1.6... so it's curious.

The error occurs on my local-server and on my webserver. hm.

TR
TR's picture
Offline
Bug FinderFAQ ModeratorGetting busy with the Ubercode.
Joined: 11/05/2007
Juice: 3424
Re: workflow-ng 1.6

I've never seen a JS error here. Can you give me a URL to look at? I tried installing and enabling shipping quotes on a fresh install of beta 3 this morning, and it worked, but only after some messing around with workflow-ng. There's something really screwy going on with that module... In this post http://www.ubercart.org/comment/9688/Re-Its-works-m I describe the procedure that makes it work for me. It doesn't sound like this is your problem, but you never know...

The other thing I noticed at one point when I upgraded Ubercart a few weeks ago was that my browser was caching JavaScript, and I got a number of JS errors as a result. They went away after I flushed my browser cache.

<tr>.
michels's picture
Offline
Uber DonorBug FinderInternationalizationizer
Joined: 08/12/2007
Juice: 205
Patch against stupidness

D'oh. I think that's the solution:
The Payment Module defines the set_line_item() function! So it's required!
I think you should update the uc_qoute.info file to prevent errors.

----
If you want to get some error messages, try the following:

Take an empty Drupal installation. Install just the four Ubercart-Core Modules. Than install "Shipping Quotes" and "Flatrate" Module.

Now add a product to your cart and make a checkout. you should see the error I described in the post above.

Then install the Payment-Module. Go back to cart/checkout. You see the following error:

warning: key() [function.key]: Passed variable is not an array or object in
path\sites\all\modules\ubercart\payment\uc_payment\uc_payment_checkout_pane.inc on line 38.

Now install a payment method -> Now it works fine!

Hope that can help you.

TR
TR's picture
Offline
Bug FinderFAQ ModeratorGetting busy with the Ubercode.
Joined: 11/05/2007
Juice: 3424
Re: Patch against stupidness

Good catch. Instead of changing the dependencies in the .info file, that function should probably be moved to one of the core modules. Anyway, you should post this bug in Issue Tracker so that someone who can fix it will see it.

<tr>.
Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: Patch against stupidness

I had been trying to check that the payment and tax functions existed, but it looks like it didn't work. Fortunately, I found a better solution than the try/catch blocks that are there in other places.

Fixed in the repository, but you can use

if (window.set_line_item){
  set_line_item(...);
}

in your own code.

michels's picture
Offline
Uber DonorBug FinderInternationalizationizer
Joined: 08/12/2007
Juice: 205
Same with uc_weight

Tried it with the "Weight quote" - module instead.

No Syntax error. But the same set_line_item is not defined error after calling cart/checkout.

Is this my stupidness? Or is it just that buggy..
If it is my stupidness, please add a function to prevent this Smiling

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Beta 4: Problems with Shipping

Welcome back, michels, and thanks for the bug reports. I've also patched the payment pane to handle an absence of payment methods properly.