We cannot process your order without payment error
n8thh - November 11, 2009 - 16:28
| Project: | UC Free Order Payment Method |
| Version: | 6.x-1.0-beta4 |
| Component: | Miscellaneous |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
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

#1
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:
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.
#2
Well. It works if I invoke op 'total':
<?php
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.
#3
The first time into hook_order op total, the order object looks like this:
<?php
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?
#4
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.