{
	"$schema": "https://playground.wordpress.net/blueprint-schema.json",
	"landingPage": "/wp-admin/admin.php?page=wc-ticket-manager",
	"preferredVersions": {
		"php": "8.3",
		"wp": "latest"
	},
	"features": {
		"networking": true
	},
	"steps": [
		{
			"step": "login",
			"username": "admin",
			"password": "password"
		},
		{
			"step": "setSiteOptions",
			"options": {
				"blogname": "Ticket Manager Preview",
				"blogdescription": "A live WordPress Playground preview for Ticket Manager."
			}
		},
		{
			"step": "installPlugin",
			"ifAlreadyInstalled": "skip",
			"pluginData": {
				"resource": "wordpress.org/plugins",
				"slug": "woocommerce"
			},
			"options": {
				"activate": true
			}
		},
		{
			"step": "installPlugin",
			"ifAlreadyInstalled": "skip",
			"pluginData": {
				"resource": "wordpress.org/plugins",
				"slug": "wc-ticket-manager"
			},
			"options": {
				"activate": true
			}
		},
		{
			"step": "runPHP",
			"code": "<?php\nrequire_once '/wordpress/wp-load.php';\n\ndelete_transient( '_wc_activation_redirect' );\nupdate_option( 'woocommerce_onboarding_profile', array( 'skipped' => true ) );\nupdate_option( 'woocommerce_task_list_hidden', 'yes' );\nupdate_option( 'woocommerce_allow_tracking', 'no' );\nupdate_option( 'woocommerce_store_address', '123 Preview Street' );\nupdate_option( 'woocommerce_store_city', 'Playground' );\nupdate_option( 'woocommerce_default_country', 'US:CA' );\nupdate_option( 'woocommerce_currency', 'USD' );\nupdate_option( 'woocommerce_product_type', 'both' );\n\nif ( class_exists( 'WC_Install' ) ) {\n\tWC_Install::create_pages();\n}\n\n$product_id = wp_insert_post(\n\tarray(\n\t\t'post_type'    => 'product',\n\t\t'post_title'   => 'Music Festival 2026',\n\t\t'post_content' => '<p>Join us for an unforgettable music festival featuring top artists, amazing food, and a vibrant atmosphere. Get your tickets now!</p>',\n\t\t'post_excerpt' => '<p>Experience the best live performances at the Music Festival 2026. Limited tickets available!</p>',\n\t\t'post_status'  => 'publish',\n\t\t'meta_input'   => array(\n\t\t\t'_wctm_ticket'                  => 'yes',\n\t\t\t'_wctm_enable_event_details'    => 'yes',\n\t\t\t'_wctm_event_start_date'        => gmdate( 'Y-m-d', strtotime( '+30 days' ) ),\n\t\t\t'_wctm_event_end_date'          => gmdate( 'Y-m-d', strtotime( '+32 days' ) ),\n\t\t\t'_wctm_event_start_time'        => '10:00',\n\t\t\t'_wctm_event_end_time'          => '23:00',\n\t\t\t'_wctm_event_venue_name'        => 'Sunset Park Amphitheater',\n\t\t\t'_wctm_event_venue_location'    => '456 Festival Ave, Playground City, CA',\n\t\t\t'_wctm_event_organizer'         => 'Festival Events Inc.',\n\t\t\t'_wctm_event_organizer_website' => 'https://example.com',\n\t\t\t'_wctm_enable_additional_details' => 'yes',\n\t\t\t'_wctm_additional_details_title'  => 'What to Bring',\n\t\t\t'_wctm_additional_details_content' => '<ul><li>Comfortable shoes</li><li>Sunscreen</li><li>Valid ID</li><li>Your printed or digital ticket</li></ul>',\n\t\t\t'_wctm_ticket_fields'           => array(\n\t\t\t\tarray(\n\t\t\t\t\t'name'        => 'wctm_attendee_name',\n\t\t\t\t\t'label'       => 'Attendee Name',\n\t\t\t\t\t'placeholder' => 'Full name',\n\t\t\t\t\t'type'        => 'text',\n\t\t\t\t\t'required'    => 'yes',\n\t\t\t\t\t'enabled'     => 'yes',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name'        => 'wctm_attendee_email',\n\t\t\t\t\t'label'       => 'Attendee Email',\n\t\t\t\t\t'placeholder' => 'Email address',\n\t\t\t\t\t'type'        => 'email',\n\t\t\t\t\t'required'    => 'yes',\n\t\t\t\t\t'enabled'     => 'yes',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'_price'                        => '49.99',\n\t\t\t'_regular_price'                => '49.99',\n\t\t\t'_sku'                          => 'FEST-MF2026',\n\t\t\t'_stock_status'                 => 'instock',\n\t\t\t'_manage_stock'                 => 'yes',\n\t\t\t'_stock'                        => 500,\n\t\t\t'_virtual'                      => 'no',\n\t\t\t'_downloadable'                 => 'no',\n\t\t\t'_product_type'                 => 'simple',\n\t\t),\n\t)\n);\n\nif ( is_wp_error( $product_id ) ) {\n\treturn;\n}\n\nwp_set_object_terms( $product_id, 'simple', 'product_type' );\n\n$product = wc_get_product( $product_id );\nif ( $product ) {\n\t$product->save();\n}"
		}
	]
}
