Discussions

Workflow for custom checkout

First off, this system is absolutely genius. I've done a few small projects with Drupal Commerce, and I can't imagine not using DC. If you understand Drupal and have programming skills and know how to build an architecture, I can't imagine a case where this isn't the system to use.

With that said, I have a question about an implementation I'm putting together for a client. They want the checkout review and payment in a modal window, structured and styled a very specific way. Getting the form into a modal isn't an issue, as I've done that many times, but I'm curious about the best way to present the checkout payment pane where the credit card info is entered.

It seems like I build my form to display in the modal, and within a section of the form, I call commerce_checkout_pane_load() to load my payment pane. From there, DC takes it from there. The client was only specific about the review and payment display.

Is it as simple as this? Or, is the best way to do it when the user is ready to check out, I have some callbacks hooked in to call my specific review and payment forms? I think I have the concept, so I'm just trying to get some clarity.

After I build and implement this, I'll submit back what the requirements were, and how I implemented it for others who need to do the same thing.

Thanks for any help!

delta195
Posted: Mar 19, 2014

Comments

delta195 delta195 on March 20, 2014

I'm looking at commerce_checkout_pages() right now. It invokes hook_commerce_checkout_page_info(). Currently, I have a regular form with various markup fields. Once section I want to be located above the payment pane, and the other section of form fields I want located below it. At this point, it appears I want to create two new panes for this page; one at the top, the payment pane weighted next, and then the last pane.

Now I'm wondering if I want to structure my /cart page the same way. I have a custom URL for our cart. I have a few AJAX form fields that update some custom fields on the order, but those reside in blocks, where I handle them individually. I think I want to create a custom pane for those as well.

Anyway, I now need to figure out how to create my custom panes, which should be straight forward, and looks like I do that in hook_commerce_checkout_pane_info(). From there, the main thing I need to figure out is how to call my custom page as a modal.