If the total cart value is 0 then the billing fields should be un-required.
Should the billing pane just be hidden or are there reasons it may be required by some users? Maybe the option to hide should be configurable?
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | uc_free_order-no-billing-2.diff | 822 bytes | john franklin |
| #10 | uc_free_order-no-billing.diff | 521 bytes | john franklin |
Comments
Comment #1
Critical Tinkerer commentedIf the billing pane is hidden, I'm curious how the checkout is handled on this.... otherwise items would stay in the cart, no?
Comment #2
rszrama commentedI think it can be hidden as long as we make sure the module alters the #required field for the form elements. I've done this in a custom job for a site in the past, so I'm sure I can manage. Good feature request. I am going to move it to the current branch, though.
Comment #3
md2 commentedcan this be added to the drupal 5 branch also?
Comment #4
buddaThe uc_free_order.js needs a function amending:
Then in the module, replace the hook_form_alter() function with:
I've only tested this against 5.x UC 1.x
Comment #5
les limsubscribing.
Comment #6
micheleannj commentedsubscribing...
I've done it in the past to just add $form['panes']['billing']['#access'] = FALSE; to a module, but now I'm using uc_coupons and that solution doesn't work...
Comment #7
j9 commentedGreat feature request.
What is currently the easiest way to hack it so that billing doesnt show and isnt required?
Comment #8
El Bandito commentedYep, I'd like this too i.e. no billing information if the order is free. For 6.x version. Any chance of a new release ?
Thanks for all your efforts,
El B
Comment #9
rastarr commentedSubscribing.
Any idea when this feature is likely to be added? Seems like the request has been asked many times in the past but without any action.
Anyone?
Comment #10
john franklin commentedThe attached patch seems to work for 6.x. I'm not very familiar with Drupal & Ubercart programming, so I'd appreciate it if someone more expert could look it over.
Comment #11
panthar commented@John Franklin
This patch does not work, at least for new versions of ubercart.
Reason is, the $order array is not created (and so $_SESSION['cart_order'] is therefore not set) the first time they goto the check out page.
The $order array seems to be created at the checkout review, and subsequently, $_SESSION['cart_order'] is populated.
So the patch you provided only works if they have gone to the review page and then continue shopping -- Not what I (and probably most of us) need.
Looking into how else to solve this for 6.x so that this does not occur. Will post code as soon as I got it.
Thanks.
Comment #12
panthar commentedWell that did not take Long,
JUST BELOW (around line 32)
drupal_add_js(drupal_get_path('module', 'uc_free_order') .'/uc_free_order.js');
INSERT:
$cart_contents = uc_cart_get_contents(uc_cart_get_id());
$item_total=0;
foreach($cart_contents as $item){
$item_total += $item->price;
}
if ($item_total == 0) {
unset($form['panes']['billing']);
}
Since the $order array is not created on the checkout pane I alluded to in the last thread, if you want to disable billing properly (so that it works the first time you goto the check out page), we have no choice but to find the price from the cart items like I did here. Obviously there may be a slight performance slow-down, since we have to load the items and parse them.
Thanks.
Comment #13
john franklin commentedIs it sufficient to just review the cart, or does there have to be another page view somewhere? I have this on a site combined with uc_signup, which introduces some intermediate screens between the review and checkout pages to handle the signup pieces. That would explain why it works fine on my site but not elsewhere.
Thanks for looking into this.
Comment #14
john franklin commentedThis patch attached is the code in #12 with indentation and spacing cleaned up. I've tested it on my site and it works fine, both with zero-dollar and non-zero-dollar orders.
Comment #15
john franklin commentedBTW, the patch in #14 is against 6.x-1.0-beta4.
Comment #16
scotwith1t#14 works perfectly. thanks john. i don't think this will be added permanently, but i set to RTBC just in case ryan looks at this module again some day :) it makes sense to me though...if it's a free order, why show the billing pane at all.
Comment #17
socialnicheguru commentedI am using uc_signup with this module. this patch is what I need.
Is there a way to remove the billing page and even the order verification screen for a free order? would I have to use something like cart links?
Comment #18
scotwith1ti'm with socialnucheguru, how would you take this a couple steps further and let the checkout process end right there on the checkout screen and not have to go to review the order or at least remove the billing info from the review screen?
Comment #19
john franklin commentedThere is a pretty massive alteration I would like to see to the process that better handles use cases where UC Restrict Qty, UC Price Per Role, UC Signup and UC Free Order are all active.
Right now, UC Price Per Role gives guests the member's rate, not the regular rate and all of our members have to go through six screens to signup themselves for a free-for-members event.
Comment #20
stvnjhncndy commentedI'm with #17 and #18. When I complete a free order after the review page, I still get a required fields error message from the billing information. The order is submitted fine, but could be confusing to an end user. I'd like to be able to skip the review page and have no errors appear.
Comment #21
janton commentedyes i also like #17 and #18
but what to do with anonymous users registration?
Perhaps this is off-topic:
I also think the price is strainge $0.00 perhaps change it to text "Free" or "Free-Trail" or a option to put that text in yourself (as admin)
Comment #22
sshhll commentedHi,
Would you point me the right direction on where i should Insert this hack?
Thanks,
Sam
Comment #23
sshhll commentedHello,
Now i place this #10 John's hack and my billing panes disappear before the coupon applies.
Can some one point me to the right direction?
$order = uc_order_load($_SESSION['cart_order']);
if ($order->order_total == 0) {
unset($form['panes']['billing']);
}
Jonh's second hack doesn't work for me.
I don't have any recurring billing or anything. Just wanted to skip the billing if the customer use the coupon and if the total order come out to $0.
Also, no tax on my product and not using any uc_signup.
Please advice.
Comment #24
aLearningGuy commentedHow can we suppress the billing field should a coupon (uc_coupon) bring the price down to 0?
Comment #25
aLearningGuy commentedHere's what I did, if anyone has a cleaner way let me know - this basically repopulates the billing fields and then hides them when the coupon is applied - thus getting around the "required field" problem.
modify the uc_free_order.js as follows:
Comment #26
hedac commentedI'm using #25 solution.. for me it works... thanks
Comment #27
hedac commentedalthough... one problem is that next time the user goes to checkout, not a free order this time... there is the saved address billing COUPON ORDER as a new address.
Comment #28
squarecandy commentedI realized I can use the product panes module for this issue in my particular situation: http://drupal.org/project/uc_product_panes
Just add specific product panes to your free product under Edit > Features - eliminate the "billing" pane and you're good to go.
Of course this only works if you have a specific free product - if you're using a discount code or something else to get the $0 amount you'll still need a solution like the ones above...
Comment #29
hedac commentedthank you #28 for that suggestion squarecandy
that workaround works for me too.
Comment #30
squarecandy commentedYou're welcome, hedac.
It surprised me when I realized it worked... kind of scary actually.
need to make sure anyone who can access uc_product_panes options knows about this.
Comment #31
mattcasey commentedI extracted the important bit of uc_product_panes, here's the relevant code to remove the billing pane on Checkout Submit when the order is $0.00 and free order's enabled: