WooCommerce Extension – Checkout Step

Introduction

The WooCommerce Checkout Step is useful when you want to let your users place an order at some point in the workflow after they submit the form. This step is available in the Step Type options for every form, but once you enable “Create Entry” in the form settings, the Checkout Step is no longer available.

With this step, you need to select an assignee by select Users/Roles or Email fields. The assignee will get an email with a “Create a WooCommerce order” link, which will lead them back to your store’s checkout page, so they can place an order.

Checkout Step Settings

Assign To

Select Assignees by Users/Roles or Fields (you need to have email fields in your form).

Display Fields

You can select which fields to display in the workflow details page.

Emails

Two merge tags can be used in the message – 
{workflow_woocommerce_checkout_link} and{workflow_woocommerce_checkout_url}
The link merge tag supports the “text” attribute, e.g. {workflow_woocommerce_checkout_link: text=”Place an order”}. The default text is “Proceed to checkout”.

Order Received Redirection

If you want to redirect your users right after they make a payment, you can specify a page from the dropdown. The redirection means your users won’t be able to see the WooCommerce order receipt (thank you) page but will see the page you specify (like the Workflow Inbox).

Add A Product to the Cart in the Checkout

By default, the “Create a WooCommerce order” link will lead assignees back to the WooCommerce Checkout page, but if they don’t have anything in the cart, they cannot start the checkout process. If you want to add a product to the cart when the assignees click on the link, please use the following snippet. You’ll have to change the “add-to-cart” param to the product ID you want the customer to purchase.

1
2
3
4
5
6
function my_gravityflowwoocommerce_payment_step_url( $url ) {
    // Change 130 to the product id you need.
    $url .= '&add-to-cart=130';
    return $url;
}
add_filter( 'gravityflowwoocommerce_checkout_step_url', 'my_gravityflowwoocommerce_payment_step_url' );