Shipping quotes - flat rate - not calculating

Posts: 17
Joined: 08/07/2007

Before "the crash" I had a problem with the shipping not being calculated on the check-out-panes - And since it was flat rate - it was not hard to calculate Eye-wink
But with the help from Lyle (Thanks a lot) I got it to work.

While I was focusing on some other issues it broke again! Not absolutely sure if it's broken by the bzr-updates I did on the way, or if I goofed some code up??

Any help will be Appreciated - Thanks. Smiling

Posts: 11
Joined: 08/22/2007
Internationalizationizer

Hello,

I have the same problem I think and I have enabled everything that needs to be enabled (?)

Administer -> Store Administration -> Configuration -> Shipping Quote Settings
Shipping methods:
Flat Rate per Order is enabled.

In Quote Methods -> Flat Rate, Order Shipping Rate is set to 200.

In Checkout Settings -> Checkout Panes, Calculate Shipping Cost is Enabled

When I go to the checkout form, and click the button called "Click to calculate shipping cost." nothing happens.

I tried to replace Ubercart with the latest Alpha version, but I got some weird "Page not found" messages so I felt I better stick to the current version before I mess something up.

Please help out.

Posts: 11
Joined: 08/22/2007
Internationalizationizer

Managed to install alpha 5 now.

I put in a misc. address in the shipping/billing fields and get this error now when pushing "Review Order" button:

Calculate Shipping Cost
Error calculating shipping: $0.00

Not very helpful error message.

I have enabled the flat rate module, and "Flat Rate per Order" is ticked in "Shipping Quote Setttings". In the submenu "Flatrate Settings" I have put 200 in Flat Rate per Order.

Anything else I need to change? Does Flat Rate depend on a valid ZIP code or something like that (which would be weird) ?

edit; "Default shipping quote type" is set to "Flat Rate per Order"

edit2; if it is of any help the error message seems to originate from this line of code in the quote module.

$label = is_null($_POST['quote-option']) ? t('Error calculating shipping') : $method['quote']['accessorials'][$arg1->quote['accessorials']];

Posts: 82
Joined: 08/12/2007
Uber DonorBug FinderInternationalizationizer

I have the same problem, but only when i'm logged in.
As a guest-user it is calculated rightly.

Posts: 11
Joined: 08/22/2007
Internationalizationizer

I tried without being logged on, got the same error message :/

I tried upgrading JQuery also, didnt make any difference either (since it helped in a similar case below)

http://www.ubercart.org/forum/bug_reports/189/not_selecting_check_box_sh...

edit again: Since I am obviously a retard, I take back everything I said about alpha-5.. I realised that version is from April Sticking out tongue

Posts: 2267
Joined: 08/07/2007
AdministratoreLiTe!

(Saw your edit, but I'll say this anyway.)
It really would be best if you used the current version of Übercart, which is alpha7b or the dev version in the Bazaar repository. When ever you update any module's code, you should go to yoursite.com/update.php as the first user to update the database tables.

Other than that, I don't know what could cause the shipping quote not to work. It's not like Flatrate has to do anything but return a number in the database.

Posts: 11
Joined: 08/22/2007
Internationalizationizer

Thanks for your patience. I am bazaar-ing the latest dev version, will experiment more tonight and let you know. I used alpha-7b before I managed to.. hrm. .downgrade by mistake Eye-wink So, the problem has something to do with my settings for the store in general maybe, or the products.

Posts: 17
Joined: 08/07/2007

Hi all

I've used the update.php script but still have the problem.

I'm using the newest bzr-version.

I'm wundering if the following is right (or some "leftovers" form earlier versions):

Under Shipping settings it say "Nothing to see here."

And under shipping quotes settings -> shipping types it says "small package - standard". I'm not sure but I think that I remember this type beeing called something different earlier??

Also, Lyle, there used to be some relation between the shipping quote and zones, right? (or did I dream this?)

Is there a way to make sure you have the right modules for this to work?

Say getting newest version from bzr, taking just uc_flatrate, uc_quote, uc_shipping ? How about the checkoutpanes where are they located?

Is this a wrong approach?

Have a nice weekend. Smiling

Posts: 2267
Joined: 08/07/2007
AdministratoreLiTe!

You should be able to get shipping quotes with just uc_quote and any of the quoting modules: uc_fedex, uc_flatrate, uc_ups, uc_usps, or uc_weightquote. The checkout and order panes are in uc_quote.

uc_shipping is used on completed orders when you are ready to send the packages to the customer. Without any 3rd party integration, it doesn't do more than bookkeeping, however. Eventually, we want to have modules that will let you print labels for various services right from your website. It governs the "packages" and "shipments" tabs on the order screen. I made a page for configuration settings, but I haven't actually found any to make yet.

The default shipping type used to called "box", but I found out that having a separate shipping type for flatrate and not any of the others was just confusing. I don't know where "standard" is coming from though.

There's been a lot of talk about linking shipping methods to countries, but so far, there hasn't been any actual code in that direction. There will be as soon as I figure out how to make it work, though.

I really don't know what would cause things to not work for you. Sad It works on our sites, so I have a real hard time figuring out what's wrong. Maybe JavaScript, maybe some obscure setting I've forgotten. I don't know.

Posts: 42
Joined: 08/08/2007

www.taggedcheap.co.uk The cheapest price shop

I had the same problem but I have hard-coded
this is with giving problem
in
uc_quote.module:
line 834

   
      $arg1->quote['rate'] = $_POST['rate'][$arg1->quote['accessorials'];
      $label = is_null($_POST['quote-option']) ? t('Error calculating shipping'):

and here is what i hard-coded

  line 834         $arg1->quote['rate'] = /*$_POST['rate'][$arg1->quote['accessorials']];*/5.00;
  line 839         $label = is_null($_POST['quote-option']) ? /*t('Error calculating shipping')*/t('Shipping Rate') : ]

--

www.taggedcheap.co.uk The cheapest price shop

Posts: 11
Joined: 08/22/2007
Internationalizationizer

The results are the same as before. No flatrate is being calculated when hitting the Calculate button, despite the fact I have completely removed and reinstalled Drupal and Ubercart and all the other modules. I used the latest alpha of Ubercart. I also removed the MySQL tables before reinstalling, so no cached data was left behind.

I am going to do something similar to the solution above in order to get things working in the meantime, but I will keep an eye on this thread if something interesting comes up.

edit: Maybe time for some serious troubleshooting. I will take screenshots of every configuration screen and post them here.

I have tried the shopping cart in Mozilla Firefox 2.0.0.6, with Javascript enabled. I have tried it both in Windows XP and Ubuntu Feisty Fawn.

edit2: if you want to have screenshots and/or info about other parts of the Ubercart configuration, send me a PM or something.

edit3: I added 3 screenshots from a test chechout, including the order review. In the Order Review screen you can clearly see it has calculated the cost to $0 Sad

edit4: Javascript seems to work, because I can see the "bar" loading when I press the Calculate Shippin g Cost button... it must be something related to the PHP code itself (indirectly by wrongly configured Ubercart, possibly.. but I dont know what check box or input field I have missed that would fix the issue).

AttachmentSize
review order.gif52.6 KB
test checkout part 2.GIF35.77 KB
test checkout.GIF52.72 KB
checkout2.GIF30.48 KB
checkout1.GIF46.44 KB
quote settings3.GIF50.83 KB
quote settings2.GIF55.71 KB
quote settings1.GIF51.52 KB
product3.GIF29.85 KB
produkt2.GIF33.08 KB
product1.GIF46.76 KB
Posts: 2267
Joined: 08/07/2007
AdministratoreLiTe!

The problem's in the code. I finally found it.

The next to last line of the uc_flatrate.module should not have drupal_to_js. The line should just be
return $quotes;
Compare with the function before it, which handles the flatrate by product quote.

So sorry for all the frustration this has caused.

Guest (not verified)

Thanks a lot, Lyle!
I am going to test the solution right away Smiling

Posts: 11
Joined: 08/22/2007
Internationalizationizer

Yay, it works now! But I had to upgrade from Drupal 5.1 to 5.2 before I managed to get it working, no clue why (used Fantastico at my web hotel before, but now I installed everything manually).

Posts: 17
Joined: 08/07/2007

Dear Lyle

Thank you so much.

The frustration is what to expect, when using "beta software", but the help you and Ryan (and other kind people) provide us, is really amazing. Thank you for taking our questions serious. Following up on a tread like this one.

Thank you. I'm so happy to get this fixed. Smiling

Posts: 82
Joined: 08/12/2007
Uber DonorBug FinderInternationalizationizer

Hey at all.


My calculation works (alpha 7b). There's just one js-error "getTax is not defined".
But when I delete the drupal_to_js, it doesn't work anymore.

So, I just want to say that I think, the problem is a bit more complicated then just removing the drupal_to_js funtion...

Maybe I try to give a bit more precise report when I have more time.

Sry, everything is ok. I've used the wrong version.

Posts: 2267
Joined: 08/07/2007
AdministratoreLiTe!

Oh, good. I was getting a little worried yesterday, not being able to see why that would happen. Glad everything worked out.

Posts: 82
Joined: 08/12/2007
Uber DonorBug FinderInternationalizationizer

Yes, I'm sorry about that. I know how it is to get such bad feedback.

But I think I found another bug, how the flatrate is not calculated.
Try it out:
- Go to the checkout page
- Fill out everything, but don't touch the billing information.
- Click "Review Order"
- You get an error, because you don't fill out the billing info. So fill it out now (or copy). Don't touch anything else.
- Now click once again "Review Order"
- You come to the review page and you see "Error calculating something"

greetings
Mic

Posts: 2267
Joined: 08/07/2007
AdministratoreLiTe!

I've redone the way shipping methods are chosen by the customer, so I don't think this will be a problem any more. The customer will still have to click the "Calculate shipping quote" button, but if they don't they get an error message. I noticed on the Livetest, the credit card form isn't filled out the second time, either.

Posts: 24
Joined: 08/29/2007

I just tried using the latest shipping quotes module gotten from bazaar, and it just doesn't work Sad Whenever I click "calculate shipping costs" I just get the everlasting "processing" bar. I am only using the flat rate module btw.

Posts: 2267
Joined: 08/07/2007
AdministratoreLiTe!

Are you getting any JavaScript errors? What does Firebug say is happening when you try to get the quote? Have all of the pages under "Shipping Quote Settings" been set up correctly?

koncept (not verified)

I am having the same issue as mentioned above about a constant "progress bar" that goes no where. I have downloaded the latest version from the csv. thus far i have not seen any errors.

Posts: 95
Joined: 09/24/2007
Getting busy with the Ubercode.

update: after updating my version of firebug i get the following messages
see attached screen shot

btw the post as koncept is also mine

edit:

I sorta found my problem...if i switch from iis to apache 224 it works so i think there is a bug in iis that is causing my problems. sorry for the confusion...

AttachmentSize
uber.jpg102.46 KB