Hi all, please help. I am using this module so that certain customers with the correct coupon code can recieve their entire cart for free, however once the code is entered and it shows the total as £0, the free order button comes up but when i continue to review order, i get the error "we cannot process your order without payment".
Any ideas?

Thanks in advance

Comments

webchick’s picture

Version: 5.x-1.0 » 6.x-1.0-beta4
Category: support » bug

I'm also seeing this on the latest 6.x-1.0-beta4 release.

The subtotal comes out as 0, but the order total becomes full-price:

Price mis-match

I threw some debugging code in uc_free_order_order() and it appears the problem is that the line uc_payment_enter($arg1->order_id, 'free_order', 0, 0, NULL, t('Checkout completed for a free order.')); never gets called.

I checked the docs for http://www.ubercart.org/docs/api/hook_order and it appear 'submit' is a valid operation; I also tried 'total' and 'save' but neither seemed to have an effect.

webchick’s picture

Well. It works if I invoke op 'total':

function uc_free_order_order($op, &$arg1, $arg2) {
  if ($op == 'total') {
    return -199;
  }

....
}

But obviously this is no kind of fix, since:

a) Not everyone's products cost $199. ;P
b) This makes /all/ orders free; I need to somehow get context that the free payment system was used, but I don't see that embedded anywhere in the order object. $arg1 doesn't yet have the payment_method property that it has in op submit. Hmmm.

webchick’s picture

The first time into hook_order op total, the order object looks like this:

stdClass Object
(
    [products] => Array
        (
            [0] => stdClass Object
                (
                    [cart_id] => 348
                    [nid] => 2
                    [qty] => 1
                    [changed] => 1259898579
                    [data] => Array
                        (
                            [shippable] => 0
                            [restrict_qty] => 1
                            [module] => uc_product
                        )

                    [cart_item_id] => 231
                    [title] => XXX
                    [vid] => 37919
                    [cost] => 0.00000
                    [price] => 199.00000
                    [weight] => 0
                    [module] => uc_product
                    [model] => XXXX
                )

        )

    [order_id] => 0
    [uid] => 0
    [primary_email] => x@x
    [delivery_first_name] => 
    [delivery_last_name] => 
    [delivery_street1] => 
    [delivery_street2] => 
    [delivery_city] => 
    [delivery_zone] => 0
    [delivery_postal_code] => 
    [delivery_country] => 0
    [billing_first_name] => 
    [billing_last_name] => 
    [billing_street1] => 
    [billing_street2] => 
    [billing_city] => 
    [billing_zone] => 0
    [billing_postal_code] => 
    [billing_country] => 840
    [line_items] => Array
        (
            [0] => Array
                (
                    [title] => Subtotal
                    [type] => subtotal
                    [amount] => 0
                    [weight] => -10
                    [summed] => 1
                )

        )

)

I'm not sure what in there I can switch on to tell that this order was affected by uc_free_order module. Maybe subtotal?

webchick’s picture

Hm. I think I'm heading down the wrong track.. in our case, this seems to be uc_discount module related... that module is not properly applying the price adjustments that are set up in our conditional actions.

rismondo’s picture

subscribing

fletchgqc’s picture

Version: 6.x-1.0-beta4 » 6.x-1.x-dev

Just installed the latest dev version and am receiving this error. I think webchick is suffering from a different error though; I'm having the exact same problem as in the original report by Nathan.Ray - everything including the order total looks correct, only this error message comes up and blocks you from progressing.

fletchgqc’s picture

OK I changed the text on line 36 to say "Order total is $order->order_total. We cannot process your order without payment." and thereby realised that the VAT is still being charged... complicated but I think the problem does not rest with this module so I'll leave it here. Might I suggest that this text be changed in the module to something like what I've written above - will help future people debugging.

nirvanajyothi’s picture

Not completely similar to the error here. But adding if somebody requires it later.

We got the error when the order Total was a negative 1 as the discount applied was $111 against subtotal of $110.

In our case changing the coupon discount from $110 to 100% changed the Total to zero and the error went away.