34 replies [Last post]
geocalleo's picture
Offline
Joined: 12/30/2009
Juice: 7
Was this information Helpful?

Hi everyone, hopefully someone can help me out here. I'm having a small but HUGE issue with one thing. I have a client that wants to make a donations page that looks exactly like this (https://www.fundraisingbynet.net/fbn/contributeFederal.asp?guidRegistrat...). The problem is that I need to "add to cart" before I can go to the checkout page. I'm looking to be able to combine the product and the checkout in one single page. Please tell me this can be done, as the client is adamant about making the donation form exactly like this. They are afraid that users won't stay to finish the checkout if they do not do it all on one page.

I looked at the civiCRM and I'm not really happy with it as I'm having many issues with installing it to configuring it. Can anyone point me in the right direction?

jrowny's picture
Offline
Joined: 01/08/2009
Juice: 297
Re: One product and checkout page

I am currently working on this because I've seen it asked for a lot.

geocalleo's picture
Offline
Joined: 12/30/2009
Juice: 7
Re: Re: One product and checkout page

Yeah, it would be an awesome feature to have! Thanks for working on it. If you need any help, I would love to try and contribute with whatever I can.

geocalleo's picture
Offline
Joined: 12/30/2009
Juice: 7
Re: Re: One product and checkout page

Hi Jrowny, have you started playing with this? If not, my time is actually about to open up a bit and wouldn't jumping in and working on creating a module for this. Let me know where you are on this.

jrowny's picture
Offline
Joined: 01/08/2009
Juice: 297
Re: Re: Re: One product and checkout page

Go for it, I actually got busy with other projects at the moment.

bevinlorenzo's picture
Offline
Joined: 08/11/2008
Juice: 23
I need the ability to do something similar.

I need the ability to do something similar and am having a difficult time discovering the best method to accomplish it. I am developing a site that has two levels of membership - Free and Paid. I want the anonymous user to "create account" and as a part of the process of adding profile and location information have a dropdown to select the product (membership level). Within the same registration process, add CC information and consent to monthly billing.

If thats not hard enough, I am wanting the user to be able to change their membership level (Upgrade from Free to Paid) in the User Profile Edit page... In a nutshell, this:

http://basecamphq.com/signup

I don't think there is a module that can do what I am looking for, so what would be the appropriate hooks to use in a custom module to accomplish this?

Richard Jones's picture
Offline
Joined: 06/03/2009
Juice: 43
"express" checkout

I think this is similar to something I am working on at the moment- actually I have to get it done pretty quickly for a client.

I can't see the example page as I am outside the US, but I think you are describing a similar thing:

1) Show a product on a page
2) Show the entire checkout on the same page
3) Allow the user to checkout whilst the product automatically adds to the cart.

In my definition, this is an "express checkout" that means you can have a product landing page to purchase in 1 step.

Here are my findings so far:

* I created a module that would attempt to display the checkout as a block
* At the beginning of the block code, I lifted some of the cart links module code to automatically empty and add the product to the basket
* I limited the block so that it will only display if on a product node page

That works fine. The cart displays and I can enter card details etc.

I then send the user to the order review page at which point the workflow is back to normal.

There are a couple of major problems that I haven't solved yet:

1) Cart review page bounces you back to the checkout page if the page referrer isn't the checkout page - easy to fix with a hack, but not ideal
2) If you use credit card as payment process- and a direct payment gateway (we use SagePay), the encrypted card data is lost along the way.

I have been banging my head against this for days now, so anyone else's insight would be very welcome!

Hope this is relevant and I am not hijacking the thread.

Richard

bevinlorenzo's picture
Offline
Joined: 08/11/2008
Juice: 23
Richard, I don't think what

Richard,
I don't think what you are describing is too far from what I need. I would like to help with the module as it is a high priority for my client to get this functionality. Please post.

Why would the encrypted data get lost along the way? Is the functionality restricted to the checkout page somehow?

bevinlorenzo's picture
Offline
Joined: 08/11/2008
Juice: 23
geocalleo and jrowny, Have

geocalleo and jrowny,

Have either of you started or made progress on this? I just want to make sure we are not duplicating efforts.

Thanks.

Richard Jones's picture
Offline
Joined: 06/03/2009
Juice: 43
Work in progress code

Here's a zip of the module I am working on. Not finished by any means and does need ubercart core hacks to make it work.

However, maybe it will help someone else or someone else can help me resolve the remaining issues.

Richard

AttachmentSize
uc_one_step_checkout.zip 9.11 KB
shi99's picture
Offline
Joined: 02/19/2010
Juice: 7
Re: Work in progress code

I've just started working on a site that requires simular functionality that has been mentioned here.

Thanks for the work in progress on your "one step checkout" you uploaded. I'm very new to drupal but I'm sure it will help me in trying to figure out how to make the site.

daltontom7782's picture
Offline
Joined: 04/12/2012
Juice: 6
painting

I've simply started performing upon a website which needs simular efficiency which has been mentioned here.
Thank you for the work in progress upon your "one move checkout" you uploaded. I'm very new to drupal but I'm certain it may help me personally in trying to figure out steps to make the internet site.

zeezhao's picture
Offline
Joined: 04/23/2008
Juice: 969
Subscribing. Also see my

Subscribing.

Also see my comments here, in case can help: http://www.ubercart.org/comment/49792

Drexler's picture
Offline
Joined: 02/17/2010
Juice: 11
Subscribing The non-profit I

Subscribing

The non-profit I work at is badly in need of this functionality as well--the more steps there are for making a donation, the more people don't complete the process.

ecstasy2's picture
Offline
Joined: 02/21/2010
Juice: 11
hi there. i'm suscribing

hi there.
i'm suscribing too.
i'm digging throuth the code since 7hours to see why the session get lost along the way.

this will be a good thing to have.

ecstasy2's picture
Offline
Joined: 02/21/2010
Juice: 11
Re: hi there. i'm suscribing

No one with a solution yet?
please if you have fixed the problem please share: i deadly need this.

Thanks.

ecstasy2's picture
Offline
Joined: 02/21/2010
Juice: 11
OMG it works

i finaly what the hell was going on under the hood thank to ZendDebugger.

debugger are tools i use often but sometime i'm lazy and don't want to configure it after a OS re-installation this result often in alot of loss of time.

So here is the problem:

uc_credit.module don't want the $_SESSION['sescrd'] variable to persist on any other pages than the "cart/checkout" one.
so what it does is using hook_exit to remove that variable if we are not viewing this page. and guess what? we are not looking at "cart/checkout" Smiling we are in fact on a "node/nid" page.

So now i got my first one page checkout page working like a charm.
We have many options:

  1. patch uc_credit (not a goo idea)
  2. making uc_credit think we are on "cart/checkout" by changing $_GET['q'] to "cart/checkout" wich is even worse i think because many modules that should act on node view page won't work anymore if they are relying on the $_GET['q'].
  3. the third an beautiful solution is to backup the value of $_SESSION['sescrd' and implement our own hoo_exit to restore the value only if we are on a product page. (the trick here is to make sure that our module's hook_exit get called after the uc_credit one.

I think that we are finaly there. haven't implemented the last solution yet, but i think it will work and i will post an updated version ASAP.

by the way i think this will be a realy useful module if we fix all the bugs that might be hidden.

thanks.

TR
TR's picture
Offline
Bug FinderFAQ ModeratorGetting busy with the Ubercode.
Joined: 11/05/2007
Juice: 3424
Re: OMG it works

Instead of putting the checkout form on the product page, why don't you put the product on the checkout page, that way you won't have to hack anything.

<tr>.
ecstasy2's picture
Offline
Joined: 02/21/2010
Juice: 11
You got a point, but imagine

You got a point,
but imagine that you don't want the user to have to go througth adding a product to the cart: say that when he visite a product page we clear the cart add the actual product into the cart.
I'm actualy working on a website where the user should do a donation.

TR
TR's picture
Offline
Bug FinderFAQ ModeratorGetting busy with the Ubercode.
Joined: 11/05/2007
Juice: 3424
Yes, I understand that. You

Yes, I understand that.

You haven't explained your workflow, but I'm going to assume you have some "catalog"-like page where you list the various donations a customer can make:

Donate to X
Donate to Y
Donate to Z

What *you* seem to be doing is making these a link to a product page with a checkout form on it.
What *I* am saying is you make these a cartlink to clear the cart, add the donation to the cart, and redirect to the checkout page with the product view shown at the top.

So there is no difference in the workflow, just a difference in how you think about it. And my way can be done with theme function overrides and hooks rather than hacking Ubercart.

<tr>.
Drexler's picture
Offline
Joined: 02/17/2010
Juice: 11
Re: Yes, I understand that. You

In our case, we need people not only to be able to add their billing information, but also donation amount all on the same page as we currently have set up on another service:

https://salsa.democracyinaction.org/o/1432/t/10451/shop/custom.jsp?donat...

Which we could do in the above framework through a combination of variable price and a billing information block.

My question would be if it is harder to set up ubercart to include billing information on a product page or allow the price to be selected on the checkout page?

rj
rj's picture
Offline
Joined: 09/11/2010
Juice: 32
Re: One product and checkout page

Has any progress been made on this? TR's suggestion to use cart links is perfect EXCEPT if you want the user to select an attribute (such as a donation amount), which AFAIK you can't do with cart links.

kbell's picture
Offline
Joined: 08/22/2011
Juice: 29
Any progress on this yet?

This thread seems to have died - any luck elsewhere?

------------------
Kelly Bell
Gotham City Drupal

rj
rj's picture
Offline
Joined: 09/11/2010
Juice: 32
Re: Any progress on this yet?

I did it using the cart links idea mentioned above, you can see it here: https://www.marinersmuseum.org/cart/add/e-p1001769_q1_m0?destination=car.... It's a horrible hack of a job but does it without hacking Ubercart core. I can post source code if you're interested...

kbell's picture
Offline
Joined: 08/22/2011
Juice: 29
DEFINITELY!

I am definitely interested! Thank you!

------------------
Kelly Bell
Gotham City Drupal

kbell's picture
Offline
Joined: 08/22/2011
Juice: 29
GitHub

You should post it on GitHub, if you haven't already... just a thought.

------------------
Kelly Bell
Gotham City Drupal

kbell's picture
Offline
Joined: 08/22/2011
Juice: 29
Re: Re: Any progress on this yet?

And for the record, the way yours is set up is EXACTLY how I want mine to be. Can you tell me how you did your donation amounts, especially the "Other" piece? I'm having a hard time with that. Also I want to get rid of my SKU and Price display, as you have. Any tips? I'm sorry to be such a help-hog, but I can promise you I will pay it forward - I am constantly helping people with Drupal stuff - but I'm just not as good with customizing Ubercart as I am with other aspects yet.

Also - do you still have the "order confirmation page" that comes after, normally, or were you able get rid of that as well?

THANK YOU!!

------------------
Kelly Bell
Gotham City Drupal

jasonabc's picture
Offline
Uber Donor
Joined: 05/05/2008
Juice: 573
Re: Re: Re: Any progress on this yet?

why not just use the Drupal Donate and Pay modules? You can build a custom donation form and plug it into Authorize.net (or whatever payment method you want) without going anywhere near UberCart...

http://drupal.org/project/donate
http://drupal.org/project/payment_api

kbell's picture
Offline
Joined: 08/22/2011
Juice: 29
Re: Re: Re: Re: Any progress on this yet?

Thanks, but the client has spent a fortune getting a ton of custom modules written for deep integration with a tiny, niche payment provider (not Authorize.net or any other mainstream provider), and all of these custom modules were built for Ubercart. We're in Drupal 6 here too, btw. It's just not something it makes any sense to switch to in midstream, when the missing functionality is so trivial by comparison. 

Thank you,
K

------------------
Kelly Bell
Gotham City Drupal

rj
rj's picture
Offline
Joined: 09/11/2010
Juice: 32
Re: Re: Re: Any progress on this yet?

These are all total D6 Ubercart hacks which is why I hate to post. It's also best to do this through commerce.

Here goes:
I used uc_optional_checkout_review to get rid of the order confirmation page.

For the 'Other' field:
I created a 'Display Type: Radio button' attribute called 'Radio'; options have a default price of $0 and a default price of the amount to be donated. In addition to default donation values (ie. $5, $10, $20, etc), I created an option titled 'Other'. I then created a 'Display Type: Text field' attribute called 'Text'. I entered Label = <none> and used CSS to float the fields next to each other. I finally enabled uc_custom_price, navigated to /admin/store/settings/custom-price, and added the following:

<?php
if('[Radio]' == 'Other') {
$amount = filter_var('[Text]', FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
$item->price += check_plain($amount);
}
?>

Then I added a product class called 'Donation', to which the attributes 'Radio' and 'Text' were added.

At this point, you should be able to create two-step donation pages, meaning users enter the donation amount on the first page and credit card information on the second.

kbell's picture
Offline
Joined: 08/22/2011
Juice: 29
Awesome!
rj wrote:

At this point, you should be able to create two-step donation pages, meaning users enter the donation amount on the first page and credit card information on the second.

Thank you so much!

I have one tiny question. Your form has only the one page, which is what I want too, but you mention above that I should now have two pages. How can I go to that final step of getting it all on one page? Truly, the link you sent in your earlier post is exactly what I want. The donation amounts are slightly different, but otherwise it's exactly the same,

I'm REALLY grateful for your help. When I upgrade this site to D7 next Spring I promise I'll get it done the "right" way. But my client is screaming for this one-page checkout so loudly I'm desperate at this point.

Thank you again!
Kelly

------------------
Kelly Bell
Gotham City Drupal

rj
rj's picture
Offline
Joined: 09/11/2010
Juice: 32
Re: Awesome!

I created a hack of a module that turned this two-step donation page into a single-page form. It really is a hack, I can't emphasize that more, and dependent on the steps outlined above. Let me know if you can get this to work and I'll cleanup the module and post on Github...

kbell's picture
Offline
Joined: 08/22/2011
Juice: 29
Re: Re: Awesome!

Ok. Will do. I would at least like to see what you did, even if you think it's a hack Smiling
Thanks,
Kelly

------------------
Kelly Bell
Gotham City Drupal

scot.self's picture
Offline
Joined: 02/11/2010
Juice: 107
the two-step approach can be done more easily!

just use uc_varprice for variable prices plus an other field. done. click "add to cart" (or change text to "donate" using this module as well!). then use uc_atctweaks to skip the cart step and go directly to the checkout page.  now, the ONE PAGE option, i'm extremely interested in.  if you can post code for that, i'd love to see it.  the site i'm working on basically exists for donations only, with home page and a donate section below, so for people to have to go through a checkout process seems a bit ridiculous.  thanks!

ramy.asha's picture
Offline
Joined: 04/09/2012
Juice: 17
Hello All

Is there a single page cart/check-out option complete for Drupal7/Ubercart latest? I've really searched high and low and to be honest I am a "developer in progress" so go easy on the fancy terms. Just trying to build a UC view that looks something like this for a friend:

https://www.dinarcorp.com/buydinar.php

I'd appreciate any support or advice. I've also heard that an AJAX page can help accomplish what I'm trying to do,

Sincerely, Ramy