Cannot add 'Fetch a shipping quote' action to Flate Rate Conditional Action

Project:Ubercart Contributions
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description
Project: 
Ubercart

Hi Have all my shipping rate set up for my store using flat rate.

During the upgrade to RC2 or RC3 there has been a problem with the shipping calculations, when a user clicks on calculate shipping on the checkout page it reloads and states that you must select a shipping method to complete the order.

I have looked at Flat Rate actions and all have an action of "Email order invoice' insted of 'fetch a shipping quote', I cannot add 'fetch a shipping quote' drupal reports it has added it but it is not there.

Hope you can help as no one can order from our web site until this is fixed.

David

Version: 
Ubercart 2.x-dev
DavidPlanesTV's picture
Offline
Joined: 02/03/2008
Juice: 130
Re: Cannot add 'Fetch a shipping quote' action to Flate Rate Con

The problem was with JQuery Update, now I have removed this the shipping quotes are working again

kilna's picture
Offline
Joined: 05/24/2009
Juice: 38
Not necessarily related to jQuery
Assigned to:DavidPlanesTV» kilna

I'm having this issue and it does not seem to necessarily be jQuery related... at least I have tried installing the jQuery Update official release:

http://ftp.drupal.org/files/projects/jquery_update-6.x-1.1.tar.gz

...And the development snapshot:

http://ftp.drupal.org/files/projects/jquery_update-6.x-2.x-dev.tar.gz

...neither seems to resolve the issue.

dwkitchen, what specific steps did you take to resolve this issue?

Another user is having the same problems, see this message board posting:

http://www.ubercart.org/forum/support/11341/flat_rate_shipping

Anthony Kilna,
Pants Not Found
http://www.pantsnotfound.com

andrewtchin's picture
Offline
Joined: 06/05/2009
Juice: 16
Re: Cannot add 'Fetch a shipping quote' action to Flate Rate Con
Assigned to:kilna» andrewtchin

I am the original poster of the above mentioned forum topic...
I am using UC RC3

Is this issue to mean that we need JQuery update installed to fix this? I do not have JQuery update installed and am having this issue.

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6841
Re: Cannot add 'Fetch a shipping quote' action to Flate Rate Con
Assigned to:andrewtchin» Lyle

I think I should point out that the shipping quotes don't use the actions form in the CA settings. Even though the "fetch shipping quote" action is not shown, it is actually the only action performed by that predicate. I believe there should be some kind of change to help prevent confusion, but I'm still unsure what that change should be.

While the actions can't affect the shipping quotes, the conditions can, so double check that they are giving the answer you expect. I would also not rule out jQuery Update as a factor, either.

andrewtchin's picture
Offline
Joined: 06/05/2009
Juice: 16
Re: Re: Cannot add 'Fetch a shipping quote' action to Flate Rate
Assigned to:Lyle» andrewtchin

Ok that makes sense...so are if the conditions are met then a shipping quote is automatically obtained.
It seems like my problem still exists though...I want to obtain a flat rate quote (see attached screenshot) only if the user has one or more of a specific product in their cart, otherwise do not display the flat rate...is this the right configuration for that behavior?
Thanks

AttachmentSize
1244498843752.jpg 88.45 KB
kilna's picture
Offline
Joined: 05/24/2009
Juice: 38
The conditions are ignored
Assigned to:andrewtchin» kilna

I've played around with it quite a bit. On my instance of UC, for *any* shipping method (not just Flat Rate) which uses conditional actions, it does not matter what the conditions are... it never returns a rate quote. In fact, the only rate quotes I've been able to get are UPS.

Anthony Kilna,
Pants Not Found
http://www.pantsnotfound.com

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6841
Re: Re: Re: Cannot add 'Fetch a shipping quote' action to Flate
Assigned to:kilna» Lyle

andrew, that condition form looks like it should work.

Both of you, have you made sure that the shipping methods are enabled on the settings page under Store Configuration? It shouldn't be different, but is the CA predicate also enabled? Can you get a quote if you remove all of the conditions?

It surprises me that UPS is working but not Flat rate. It's usually the other way around since there is so much more configuration for UPS that needs to be correct.

kilna's picture
Offline
Joined: 05/24/2009
Juice: 38
It is broke! :)
Assigned to:Lyle» kilna

YES, the shipping method has the "enabled" checkbox checked under "general settings" for shipping. YES, the associated predicate is enabled under Conditional Actions.

The behavior is pretty consistent... any shipping method (not just Flat Rate) which needs a CA to work does not quote in the cart. Shipping methods which do not need an associated CA to work DO quote shipping in the cart.

Incidentally... I did not upgrade from a previous Drupal/UC install... this was all fresh.

This issue is the one remaining item for me to get my site live, any assistance would be much appreciated.

My particular installation is:

Drupal 6.12
Ubercart 2.0 RC3
lighttpd 1.4.22 (including lua and ssl)

--PHP--
PHP 5.2.6-1+lenny3 with Suhosin-Patch 0.9.6.2 (cgi-fcgi) (built: Apr 26 2009 22:11:16)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
--

Anthony Kilna,
Pants Not Found
http://www.pantsnotfound.com

kilna's picture
Offline
Joined: 05/24/2009
Juice: 38
Steak. Beer. Yes.

Please relieve me of my money in exchange for resolving this.

http://www.ubercart.org/forum/bounties/11425/steak_dinner_and_couple_bee...

Anthony Kilna,
Pants Not Found
http://www.pantsnotfound.com

andrewtchin's picture
Offline
Joined: 06/05/2009
Juice: 16
Re: Re: Re: Re: Cannot add 'Fetch a shipping quote' action to Fl
Assigned to:kilna» andrewtchin

Lyle, the flat rate is enabled, in fact even when I uncheck it, it shows up upon checkout. My CA is also enabled (see attachment - flat rate is "Rental Instrument"). My problem seems to be that it is always generating a quote; it seems to not respond to the conditions I have set - I only want to return a quote if the user has certain items in their cart, otherwise use the UPS/USPS methods (which are working).

AttachmentSize
1244747632190.jpg 72.25 KB
andrewtchin's picture
Offline
Joined: 06/05/2009
Juice: 16
Re: Steak. Beer. Yes.

I will throw in $20 for solving this...

kilna's picture
Offline
Joined: 05/24/2009
Juice: 38
Ping
Assigned to:andrewtchin» kilna

Someone please address this. I'm willing to shell out some cash to get it solved. I can render any and all assistance that I can.

Anthony Kilna,
Pants Not Found
http://www.pantsnotfound.com

Makes74's picture
Offline
Joined: 09/12/2009
Juice: 2
Re: Ping
Assigned to:kilna» Makes74

I'm having this issue to:(

quevo's picture
Offline
Joined: 08/31/2009
Juice: 11
Adding 'Fetch a shipping quote' action breaks shipping quotes
Assigned to:Makes74» quevo

This should be a blocker. Adding a weight-based conditional action causes shipping calculations to fail with the message:

"There were problems getting a shipping quote. Please verify the delivery and product information and try again.
If this does not resolve the issue, please call in to complete your order."

Is Ubercart seriously going to be released with this bug in it?

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6841
Re: Adding 'Fetch a shipping quote' action breaks shipping quote
Assigned to:quevo» Lyle

I haven't seen any of these issues, so I don't know what to fix. What do you mean by "weight-based conditional action"? To me, that could mean the weightquote shipping method, adding the shipping quote action to the predicate, or adding a condition that checks the order's total weight. Only that second option is actually wrong, because Ubercart takes care of that for you, but it shouldn't have any effect at all.

Which problem are you having?

jensnielsen's picture
Offline
Joined: 10/22/2009
Juice: 12
Fetch a shipping quote action to Conditional
Assigned to:Lyle» jensnielsen

I have a similar problem. I have added two different shipping quote methods (a flat rate and a weight based) for testing. No matter what action I assign to the predicates (uc_flatrate and uc_weightquote), nothing happens. I tried adding just custom php code "return true" to conditions, and custom php code "echo('test')" to actions as a basic test and nothing happens. I also tried lots of other conditions and actions with no effect.

When i try to add the action "fetch a shipping quote", i get the "Action added." message, but nothing happens. No action is added.

I'm using Drupal 6.14 and Ubercart 2.0 (released 21st oct. 2009)

Any clues?

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6841
Re: Fetch a shipping quote action to Conditional
Assigned to:jensnielsen» Lyle

I apologize for the confusion, but you don't need to add the shipping quote actions to the predicates. They're automatic, but hidden. If there are no conditions on the predicate, then that shipping quote should be returned all the time.

jensnielsen's picture
Offline
Joined: 10/22/2009
Juice: 12
Re: Re: Fetch a shipping quote action to Conditional
Assigned to:Lyle» jensnielsen

Thanks Lyle – I actually figured this out by traversing through the fetch_quote code in the module. It works now and that's great, but I must say it's a little confusing, interface-wise. When you add a condition, you'd expect to define an action for that condition. So at least the "Fetch shipping quote" action should be visible, with a note that you can't, and shouldn't, add any more actions. As far as I've been able to work out, any actions you add to a shipping predicate don't get executed – but you can still add them. This was what confused me the most.

Now, just to clarify to any future searchers (I was unable to fint this information in any clear form myself anywhere): If you need to define shipping per country and weight interval(!) do this:
Add a flat rate shipping quote for each possible outcome. Say you have three regions: Finland, Europe and world, and three weight intervals: 0-300g, 300-500g and 500g-unlimited. Thats 9 flat rate quotes. Name them something like: "Domestic < 300g", "Domestic < 500g", "Domestic > 500g", "Europe < 300g", "Europe < 500g", "Europe > 500g" etc. etc. When you have all the shipping quote, you edit the conditions. For "Domestic < 300g" you add two conditions: Shipping country should be Finland and order weight should be below 300. For "Domestic < 500g" you need three conditions: country should be Finland, order weight should be equal or above 300g and order weight should be below 500g. The rest should be self-explanatory. Btw. it would be really useful to define a set of countries as a region somewhere, so you don't have to select all the european countries for all your european shipping quotes. I managed to avoid this by editing the database directly, but that's not so convenient.

jibbajabba's picture
Offline
Joined: 09/20/2008
Juice: 133
Re: Re: Re: Fetch a shipping quote action to Conditional
Assigned to:jensnielsen» jibbajabba

I'm running 2.0. Do I need to upgrade to the dev version for shipping quotes to work?

enli@drupal.org's picture
Offline
Joined: 09/25/2009
Juice: 2
Same problem here
Assigned to:jibbajabba» enli@drupal.org

Running Drupal 6.14 + Uubercart 2.0.
Fresh install here, but can't add 'Fetch a shipping quote' action to Weight Quotes Conditional Action. No way.
Message: "There were problems getting a shipping quote...."

mheacock's picture
Offline
Joined: 02/03/2010
Juice: 42
Re: Re: Re: Fetch a shipping quote action to Conditional
Assigned to:enli@drupal.org» mheacock

"As far as I've been able to work out, any actions you add to a shipping predicate don't get executed – but you can still add them. This was what confused me the most."

I have some unique shipping rules to parse, stuff not covered by the standard options. I need to run a PHP action, but as you stated, I discovered that none of the uc_flatrate actions will execute.

Is this a major bug? Or is there some method to get the uc_flatrate actions to fire?

andan's picture
Offline
Joined: 07/03/2008
Juice: 5
#22
Category:» bug report
Assigned to:mheacock» Guest

Subscribed.
More information about the case:
Conditional action added to Flatrate type shipping method:

Condition: Check the payment method
One payment method selected

Result: This type of shipping method never appears.

If "Negate this condition" is checked, always appears.

Checked for other Condition ("Check an order's shipping State/Province"), it worked fine.

MySQL: 5.1.33
PHP: 5.2.9
Drupal: 6.15
Übercart: 6.x-2.2

spudette77's picture
Offline
Joined: 01/20/2010
Juice: 10
#23

subscribed. I am tearing my hair out with this! I have gone through all the instructions 15 times and I cannot get conditional actions going!!

I have three shipping rates
7.95 - two conditions - 'Check country=Australia'; 'Check products= I have 100 products highlighted, none of which are the products included in the 15.50 shipping quote.
15.50 - two conditions - 'Check country=Australia'; Check products= I have 10 products highlighted, none of which is highlighted in the 7.95 shipping quote.
Free shipping

The free shipping option works but the others don't. Could someone please help me!!! The most I have been able to get out of this was both 15.50 and 7.95 appearing and customer could choose, when I actualy need both prices included!!! AAAARRGGGG

alh
alh's picture
Offline
Joined: 02/16/2010
Juice: 36
#24

I am having a similar problem. Using Drupal 6.16 and Ubercart 6.x-2.2. Shipping quotes are parsed into four categories:

Flat rate - North America - order value less than $60
Flat rate - North America - order value greater or equal to $60
Flat rate - Rest of World - order value less than $40
Flat rate - Rest of World - order value great or equal to $40

Predicates work perfectly in Checkout but do not work in Cart. Shouldn't the code/logic between these be identical?

I also tried changing Rest of World shipping to be weight based just to see if that help. Did not. I guess I'll have to take a close look at the code.

Hope this gets resolved.

Thanks
Al

alh
alh's picture
Offline
Joined: 02/16/2010
Juice: 36
#25

Sorry - forgot to post the error condition. On the shopping cart page:

The shipping quote ignores the Country dialog box setting. It will not generate quotes for North America - i.e. Canada and the United States but always expresses the ROW quote value. Irrespective of order size and settings for state/province, zip code etc.

Al

Aibu's picture
Offline
Joined: 02/13/2010
Juice: 29
#26

This is a supposition but probably can get some brainz working on the issue.

To me it seems that conditional actions are checking against an order that still isn't an order. I haven't been able to check this, but with firebug, the javascript that calls for shipping quotes always returns blank.

So maybe, after submitting the order, conditional actions can check for parameters of this order and do the actions requested, but not before clicking on "submit order".

Also, in my opinion, there should be a default flat rate quote, meaning that, if no condition is met, at least there is a default quote to apply to the order.

I hope this can help someone!

chegga's picture
Offline
Joined: 07/20/2010
Juice: 16
#27

I have the same problem in current dev version. I tried flatrate and weightquote with same problem in uc_quote.module. If you are using conditions for one of these shipping methods ca_evaluate_conditions() returns a false in uc_quote.module (near line 890) that cause error meesage "Invalid option selected. Recalculate shipping quotes to continue.".

Without conditions it works fine.

chegga's picture
Offline
Joined: 07/20/2010
Juice: 16
#28

In my case i have found the reason why this sticky bug happens. The order of the checkout panes is the problem. If you put "Calculate shipping cost" above the address panes you get this error message. Put "Calculate shipping cost" pane under "Delivery information" and/or "Billing information" with an higher weight.

dano2's picture
Offline
Joined: 09/05/2010
Juice: 3
#29

I'm able to assign ALL actions to my flat-rate shipping method (img 1), EXCEPT "Fetch a Shipping Quote" ( img 2). As you can see, it still says "Action Added", but you can't see it, and it doesn't work. The strange thing is, this was working just fine the other day. The only thing I recall changing since then is adding Hungary to the Country drop-down. (I've removed it, and even tried starting over leaving Hungary out, and it still doesn't work). Above solutions didn't change anything. Any suggestions? Other than that, Uber Rocks!

http://i55.tinypic.com/25rf591.jpg

http://i55.tinypic.com/25qu4gh.png

Also, could anyone tell me which table contains the conditions/actions (once selected)? I couldn't find it.

[bumping self. (and liking it)]

chegga's picture
Offline
Joined: 07/20/2010
Juice: 16
#30

Hi dano2,

it is correct that you have not "Fetch a Shipping Quote". The module uses a function like this internal and does not show it in the admin. Do you have a look at your pane order (see my post above)?

dano2's picture
Offline
Joined: 09/05/2010
Juice: 3
#31

Thanks Chegga. Unfortunately I did try your solution and had no luck. "Calculate shipping cost" with a higher weight value is under "Billing information which is under "Delivery information" . You mentioned that the module will not SHOW the "Fetch a Shipping Quote" in the list of Actions. I see now that "Fetch a Shipping Quote" is in the ca_predicates table for my shipping method. But how would an admin go about removing an Action that can't be seen?

EDIT:
My apologies. I'm an airhead. I had accidentally based my condition on the BILLING COUNTRY not the SHIPPING COUNTRY. And have been checking the wrong thing for 2 nights! Thanks again.

robertlav's picture
Offline
Joined: 02/03/2011
Juice: 2
#32
Priority:critical» normal

I was tripping up with this issue as well but I managed to find a solution.

I set up my 'Flat Rate' shipping based on the product quantity in the 'Cart'.

I had 1 product - £2.95 P&P, 2 products - £2.40 P&P etc. So the more products you have the less the P&P per item.

I setup conditions for each flat rate I'd created so that it wold provide the shipping quote based on the number of products in the basket.
When I tested it out in the 'Checkout' the shipping quote would come up with an error stating - 'Problem: cannot calculate shipping method. Please contact etc...'

The Solution:
For each 'Flat Rate' > 'Condition' I had created I hadn't selected any products, hence the error. I needed to choose 'All products' in the products option for each of my flat rates. Once 'All products' was selected for each condition it worked as required.

I hope this helps someone else.

mcfilms's picture
Offline
Joined: 01/31/2011
Juice: 29
#33

Hey Robertlav -- thanks for posting that solution. The issue was kicking my but for over an hour. Thanks!