# storeengine/2.2.0/includes/database/create-cart.php

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

- Page: https://pluginprobe.com/plugins/storeengine/2.2.0/code/includes/database/create-cart.php
- Raw: https://pluginprobe.com/plugins/storeengine/2.2.0/raw/includes/database/create-cart.php
- Modified: 2025-07-31T09:22:38+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/database/create-cart.php#L10-L20`.

```php
<?php

namespace StoreEngine\Database;

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

class CreateCart {

	public static function up( $prefix, $charset_collate ) {
		$table_name = $prefix . 'storeengine_cart';
		$sql        = "CREATE TABLE IF NOT EXISTS {$table_name} (
			`cart_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
			`user_id` bigint(20) unsigned NOT NULL,
			`cart_hash` varchar(255) NOT NULL,
			`cart_data` longtext NOT NULL,
			`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
			`updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
			PRIMARY KEY (`cart_id`),
			KEY `cart_hash` (`cart_hash`),
			KEY `user_id` (`user_id`)
        ) $charset_collate;";

		dbDelta( $sql );
	}
}

```
