Skip shopping cart & add checkout form to product display page?
I am using Drupal Commerce for the purchase and registration of classes (like college courses). I am wondering if it's possible to alter the workflow like so: Product Display page contains the registration and checkout forms to directly purchase that specific course - skip the Shopping Cart and separate Checkout pages. There are no variations or dynamic attributes on the product to consider: it is a simple single product. I understand users would only be able to purchase one at a time.
I am new to Drupal Commerce (didn't use Kickstart though) and only an intermediate Drupal user, so I would appreciate really any thoughts/guidance/tutorials on how I can accomplish this, please. I found this thread which touches on the kind of functionality I need - http://www.drupalcommerce.org/discussions/541/make-add-cart-button-go-st... - However, I want to take it a step further by also merging the product display with the checkout form. I am assuming this would involve Views and possibly Rules, but I'm not sure where to even start! A View page displaying the product, where the Checkout section is a (View?) block? Where the checkout's Submit button somehow receives the product ID from the product display View?
Comments
Thanks so much for your reply Ryan! I think embedding the checkout form onto the Product Display is out of scope for me. I am trying to implement an alternative that will still make the client happy. I'm very close, but hitting a road block and wondering if you have any further guidance?
I am trying to do two things that don't want to behave simultaneously:
1. Implement your suggestion of a "Buy Now" button that redirects to checkout page when "Add to Cart" button is clicked. I have that working on a basic level. I created a new Rule that redirects to URL "checkout" on event "After adding a product to the cart."
2. I am using Commerce Registration module and have tweaked it to create a one-page checkout. (By going to Store Checkout settings and moving the "Registration Information" section out of the Registration Pane and into the Checkout Pane.) Doing this caused the issue documented here: https://drupal.org/node/1829334 which I was able to fix by adding the code from #3 to my template.php file.
HOWEVER, trying to do both these things at once causes my second issue to pop up again. After clicking "Add to Cart" the user is taken to checkout/5 (5 being order ID) which is the borked Registration Information page.
If I disable my redirect Rule, clicking the "Checkout" button on the cart goes directly to a URL of checkout/5/checkout and displays the correct one-page checkout. However, if I try to link to that URL directly from my redirect Rule itself by setting the URL to "checkout/[commerce-order:order-id]/checkout", it continues directing to checkout/5 instead no matter how much I try and mess with the Rule settings.
I hope that makes sense; it's very difficult to explain!
Not sure I really follow what's going on here, to be honest. checkout/## and checkout/##/checkout are typically always going to redirect to the same page. It could be that Commerce Registration is injecting a prior checkout page that's giving you trouble, but I haven't used the module to know how to advise.
I believe you are right about it being an issue with Commerce Registration. I will just have to work around it. Thanks so much for your assistance Ryan. :)