Skip to content

Multi-step checkout

The multi-step checkout splits the classic WooCommerce checkout into four steps: address, shipping, payment and review. Numbered steps appear above the form, and the customer moves on with the Next button. It works on the classic checkout, the form.woocommerce-checkout form rendered by the [woocommerce_checkout] shortcode.

Step Label What is shown
1 Address The billing fields (#customer_details .col-1)
2 Shipping The shipping address fields (#customer_details .col-2) and the order table, which holds the shipping methods
3 Payment The payment methods (#payment), without the order table and without the place order area
4 Review The order table, the payment methods, the terms and legal checkboxes and the place order button

The labels are fixed in the plugin and translated through the polski-pro text domain. The place order button text comes from the woocommerce_order_button_text filter, so it follows the checkout button module of the free Polski plugin.

The customer can go back with Back or by clicking a completed step in the bar. Fields keep their values, because every step is part of the same form.

If the form has no #customer_details or no #order_review, which happens with heavily rebuilt checkout templates, the script changes nothing and the customer sees the normal checkout.

Next on the Address and Shipping steps checks the WooCommerce required fields of that step (fields marked validate-required). Empty fields get the polski-field--invalid class and the first one is focused. Fields that are not visible, such as the shipping address while Ship to a different address is unticked, are skipped.

The Payment and Review steps check nothing themselves. The payment method, the terms and the legal checkboxes are checked by WooCommerce when the order is placed, and its error notices appear as usual.

There is no settings screen. The only setting is multistep_enabled in the polski_pro_checkout option, written for example with WP-CLI:

Terminal window
wp option update polski_pro_checkout '{"multistep_enabled":true}' --format=json

false restores the normal checkout.

The script build/frontend-multistep.js and its stylesheet load only on the checkout page (is_checkout()), in the footer. The script adds the step bar at the top of the form and the Back and Next buttons at its end, and writes the current step into a data-polski-step attribute on the form. The stylesheet hides the sections that do not belong to that step.

This is done with CSS on purpose: WooCommerce replaces the payment box and the order table on every checkout refresh, so anything placed inside them or set on them inline is lost. Moving to the next step triggers one checkout refresh, so totals and payment methods follow the address just entered.

WooCommerce logic and the form fields are not changed.

The module also registers a polski-pro-multistep integration with the Checkout block, which loads the same script. The script only splits the classic form.woocommerce-checkout form, so on the block checkout it does nothing and the block checkout stays as it is.

When the module is on, the checkout page gets the polski-multistep-checkout class on <body>.

Selector Element
form[data-polski-step="address"] (also shipping, payment, review) The form on the given step
.polski-steps The step bar (role="tablist")
.polski-steps__item One step in the bar, with --active, --completed or --upcoming
.polski-steps__number, .polski-steps__label The number and the label of a step
.polski-steps__buttons The wrapper of the navigation buttons
.polski-steps__prev, .polski-steps__next Back and Next
.polski-field--invalid A required field left empty
body.polski-multistep-checkout form.woocommerce-checkout {
max-width: 720px;
margin: 0 auto;
}

Each step in the bar is a <button> with role="tab" and aria-selected, so it can be reached with the keyboard.

Checkout does not split into steps

Section titled "Checkout does not split into steps"
  1. Check that multistep_enabled in the polski_pro_checkout option is true.
  2. Check that the checkout page uses the classic [woocommerce_checkout] shortcode, not the Checkout block.
  3. Clear the cache (caching plugins, CDN, browser).
  4. Check the browser console for JavaScript errors.

A required field of the current step is empty. It is marked with polski-field--invalid and receives the focus.

Polski PRO is older than 1.32.6. Update it.

This page is for informational purposes only and does not constitute legal advice. Consult a lawyer before implementation. Polski for WooCommerce is open source software (GPLv2) provided without warranty.