# storeengine/2.2.0/includes/shortcode/checkout-form.php

StoreEngine — Complete eCommerce Solution with Memberships, Licensing, Affiliates &amp; More, version 2.2.0. 52 lines.

- Page: https://pluginprobe.com/plugins/storeengine/2.2.0/code/includes/shortcode/checkout-form.php
- Raw: https://pluginprobe.com/plugins/storeengine/2.2.0/raw/includes/shortcode/checkout-form.php
- Modified: 2025-10-01T11:54:54+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/storeengine/2.2.0/code/includes/shortcode/checkout-form.php#L10-L20`.

```php
<?php

namespace StoreEngine\Shortcode;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

use StoreEngine\Utils\Formatting;
use StoreEngine\Utils\Helper;
use StoreEngine\Utils\Template;

class CheckoutForm {
	public function __construct() {
		add_shortcode( 'storeengine_checkout_form', array( $this, 'render_checkout_form' ) );
	}

	public function render_checkout_form(): string {
		$cart = Helper::cart();
		do_action( 'storeengine/cart/check_items' );
		$is_cart_empty  = $cart->is_cart_empty();
		$cart_sub_total = $cart->get_cart_subtotal();
		$products       = $cart->get_cart_items();

		if ( Formatting::string_to_bool( get_query_var( 'order_pay' ) ) ) {
			$order = Helper::get_order( absint( get_query_var( 'order_id' ) ) );
			if ( is_wp_error( $order ) ) {
				return '';
			}
		} else {
			$order = Helper::get_recent_draft_order();
		}

		$current_user_email = ( is_user_logged_in() ) ? wp_get_current_user()->user_email : '';
		ob_start();

		Template::get_template( 'shortcode/checkout-form.php', [
			'is_cart_empty'      => $is_cart_empty,
			'cart_sub_total'     => $cart_sub_total,
			'products'           => $products,
			'product_query'      => null,
			'order'              => $order,
			'current_user_email' => $current_user_email,
			'is_digital_cart'    => $cart->needs_shipping(),
		] );

		return ob_get_clean();
	}


}

```
