Changeset 3790572
- Timestamp:
- 11/08/2026 06:56:49 AM (less than one hour ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tlloancy-step-configurator-for-woocommerce/assets/blueprints/blueprint.json
r3790344 r3790572 4 4 "title": "Tlloancy Step Configurator for WooCommerce", 5 5 "author": "tlloancy", 6 "description": " One product, one configurator, a roller variant, and two steps with priced options."6 "description": "The wizard alone, on its own page, with the roller blind steps." 7 7 }, 8 "landingPage": "/ product/made-to-measure-blind/",8 "landingPage": "/blind/", 9 9 "preferredVersions": { 10 10 "php": "latest", … … 12 12 }, 13 13 "steps": [ 14 { 15 "step": "mkdir", 16 "path": "/wordpress/wp-content/mu-plugins" 17 }, 18 { 19 "step": "writeFile", 20 "path": "/wordpress/wp-content/mu-plugins/step-configurator-preview.php", 21 "data": "<?php\nadd_action( 'wp_head', function () {\n\tif ( ! is_page( 'blind' ) ) {\n\t\treturn;\n\t}\n\techo '<style>header.wp-block-template-part,.wp-block-post-title,.entry-title{display:none}.wp-site-blocks{padding-top:0}.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)){max-width:none}</style>';\n} );\n" 22 }, 14 23 { 15 24 "step": "installPlugin", … … 36 45 { 37 46 "step": "runPHP", 38 "code": "<?php\nrequire_once '/wordpress/wp-load.php';\nupdate_option( 'permalink_structure', '/%postname%/' );\n\nfunction bp_page( $title, $slug, $content, $front = false ) {\n\t$existing = get_page_by_path( $slug );\n\tif ( $existing instanceof WP_Post ) {\n\t\twp_update_post(\n\t\t\tarray(\n\t\t\t\t'ID' => $existing->ID,\n\t\t\t\t'post_content' => $content,\n\t\t\t\t'post_status' => 'publish',\n\t\t\t)\n\t\t);\n\t\t$id = (int) $existing->ID;\n\t} else {\n\t\t$id = (int) wp_insert_post(\n\t\t\tarray(\n\t\t\t\t'post_title' => $title,\n\t\t\t\t'post_name' => $slug,\n\t\t\t\t'post_status' => 'publish',\n\t\t\t\t'post_type' => 'page',\n\t\t\t\t'post_content' => $content,\n\t\t\t)\n\t\t);\n\t}\n\tif ( $front && $id ) {\n\t\tupdate_option( 'show_on_front', 'page' );\n\t\tupdate_option( 'page_on_front', $id );\n\t}\n\treturn $id;\n}\n\nupdate_option( 'woocommerce_onboarding_profile', array( 'skipped' => true, 'completed' => true ) );\nupdate_option( 'woocommerce_coming_soon', 'no' );\nupdate_option( 'woocommerce_store_pages_only', 'no' );\nupdate_option( 'woocommerce_currency', 'EUR' );\nif ( class_exists( 'WC_Install' ) ) {\n\tWC_Install::create_pages();\n}\n\nfunction bp_product( $name, $slug, $price ) {\n\t$product = new WC_Product_Simple();\n\t$product->set_name( $name );\n\t$product->set_slug( $slug );\n\t$product->set_regular_price( (string) $price );\n\t$product->set_status( 'publish' );\n\t$product->set_catalog_visibility( 'visible' );\n\t$product->set_stock_status( 'instock' );\n\t$product->save();\n\treturn $product;\n}\n\n$product = bp_product( 'Made-to-measure blind', 'made-to-measure-blind', '89' );\nif ( class_exists( 'TLSC_Configurator' ) ) {\n\t$cid = TLSC_Configurator::save(\n\t\tarray(\n\t\t\t'name' => 'Made-to-measure blind',\n\t\t\t'slug' => 'blind',\n\t\t\t'product_id' => $product->get_id(),\n\t\t\t'first_step_label' => 'Model',\n\t\t\t'layout' => 'sequential',\n\t\t\t'show_on_product' => 1,\n\t\t\t'allow_quantity' => 1,\n\t\t\t'is_active' => 1,\n\t\t)\n\t);\n\tif ( ! is_wp_error( $cid ) && class_exists( 'TLSC_Config' ) ) {\n\t\tTLSC_Config::save(\n\t\t\tarray(\n\t\t\t\t'configurator_id' => (int) $cid,\n\t\t\t\t'name' => 'Roller',\n\t\t\t\t'slug' => 'roller',\n\t\t\t\t'base_price' => 89,\n\t\t\t\t'is_active' => 1,\n\t\t\t)\n\t\t);\n\t\t$steps = array(\n\t\t\tarray( 'Fabric', 'fabric', array( array( 'Linen', 0 ), array( 'Cotton', 12 ) ) ),\n\t\t\tarray( 'Mechanism', 'mechanism', array( array( 'Chain', 0 ), array( 'Motor', 45 ) ) ),\n\t\t);\n\t\tforeach ( $steps as $index => $step ) {\n\t\t\t$sid = TLSC_Step::save(\n\t\t\t\tarray(\n\t\t\t\t\t'configurator_id' => (int) $cid,\n\t\t\t\t\t'name' => $step[0],\n\t\t\t\t\t'slug' => $step[1],\n\t\t\t\t\t'sort_order' => $index,\n\t\t\t\t\t'selection_type' => 'single',\n\t\t\t\t\t'required' => 1,\n\t\t\t\t\t'min_select' => 1,\n\t\t\t\t\t'max_select' => 1,\n\t\t\t\t)\n\t\t\t);\n\t\t\tif ( is_wp_error( $sid ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tforeach ( $step[2] as $opt_index => $opt ) {\n\t\t\t\tTLSC_Option::save(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'step_id' => (int) $sid,\n\t\t\t\t\t\t'name' => $opt[0],\n\t\t\t\t\t\t'price_supplement' => $opt[1],\n\t\t\t\t\t\t'is_available' => 1,\n\t\t\t\t\t\t'sort_order' => $opt_index,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n}\n flush_rewrite_rules();\n"47 "code": "<?php\nrequire_once '/wordpress/wp-load.php';\nupdate_option( 'permalink_structure', '/%postname%/' );\n\nfunction bp_page( $title, $slug, $content, $front = false ) {\n\t$existing = get_page_by_path( $slug );\n\tif ( $existing instanceof WP_Post ) {\n\t\twp_update_post(\n\t\t\tarray(\n\t\t\t\t'ID' => $existing->ID,\n\t\t\t\t'post_content' => $content,\n\t\t\t\t'post_status' => 'publish',\n\t\t\t)\n\t\t);\n\t\t$id = (int) $existing->ID;\n\t} else {\n\t\t$id = (int) wp_insert_post(\n\t\t\tarray(\n\t\t\t\t'post_title' => $title,\n\t\t\t\t'post_name' => $slug,\n\t\t\t\t'post_status' => 'publish',\n\t\t\t\t'post_type' => 'page',\n\t\t\t\t'post_content' => $content,\n\t\t\t)\n\t\t);\n\t}\n\tif ( $front && $id ) {\n\t\tupdate_option( 'show_on_front', 'page' );\n\t\tupdate_option( 'page_on_front', $id );\n\t}\n\treturn $id;\n}\n\nupdate_option( 'woocommerce_onboarding_profile', array( 'skipped' => true, 'completed' => true ) );\nupdate_option( 'woocommerce_coming_soon', 'no' );\nupdate_option( 'woocommerce_store_pages_only', 'no' );\nupdate_option( 'woocommerce_currency', 'EUR' );\nif ( class_exists( 'WC_Install' ) ) {\n\tWC_Install::create_pages();\n}\n\nfunction bp_product( $name, $slug, $price ) {\n\t$product = new WC_Product_Simple();\n\t$product->set_name( $name );\n\t$product->set_slug( $slug );\n\t$product->set_regular_price( (string) $price );\n\t$product->set_status( 'publish' );\n\t$product->set_catalog_visibility( 'visible' );\n\t$product->set_stock_status( 'instock' );\n\t$product->save();\n\treturn $product;\n}\n\n$product = bp_product( 'Made-to-measure blind', 'made-to-measure-blind', '89' );\nif ( class_exists( 'TLSC_Configurator' ) ) {\n\t$cid = TLSC_Configurator::save(\n\t\tarray(\n\t\t\t'name' => 'Made-to-measure blind',\n\t\t\t'slug' => 'blind',\n\t\t\t'product_id' => $product->get_id(),\n\t\t\t'first_step_label' => 'Model',\n\t\t\t'layout' => 'sequential',\n\t\t\t'show_on_product' => 1,\n\t\t\t'allow_quantity' => 1,\n\t\t\t'is_active' => 1,\n\t\t)\n\t);\n\tif ( ! is_wp_error( $cid ) && class_exists( 'TLSC_Config' ) ) {\n\t\tTLSC_Config::save(\n\t\t\tarray(\n\t\t\t\t'configurator_id' => (int) $cid,\n\t\t\t\t'name' => 'Roller',\n\t\t\t\t'slug' => 'roller',\n\t\t\t\t'base_price' => 89,\n\t\t\t\t'is_active' => 1,\n\t\t\t)\n\t\t);\n\t\t$steps = array(\n\t\t\tarray( 'Fabric', 'fabric', array( array( 'Linen', 0 ), array( 'Cotton', 12 ) ) ),\n\t\t\tarray( 'Mechanism', 'mechanism', array( array( 'Chain', 0 ), array( 'Motor', 45 ) ) ),\n\t\t);\n\t\tforeach ( $steps as $index => $step ) {\n\t\t\t$sid = TLSC_Step::save(\n\t\t\t\tarray(\n\t\t\t\t\t'configurator_id' => (int) $cid,\n\t\t\t\t\t'name' => $step[0],\n\t\t\t\t\t'slug' => $step[1],\n\t\t\t\t\t'sort_order' => $index,\n\t\t\t\t\t'selection_type' => 'single',\n\t\t\t\t\t'required' => 1,\n\t\t\t\t\t'min_select' => 1,\n\t\t\t\t\t'max_select' => 1,\n\t\t\t\t)\n\t\t\t);\n\t\t\tif ( is_wp_error( $sid ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tforeach ( $step[2] as $opt_index => $opt ) {\n\t\t\t\tTLSC_Option::save(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'step_id' => (int) $sid,\n\t\t\t\t\t\t'name' => $opt[0],\n\t\t\t\t\t\t'price_supplement' => $opt[1],\n\t\t\t\t\t\t'is_available' => 1,\n\t\t\t\t\t\t'sort_order' => $opt_index,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n}\nbp_page( 'Blind', 'blind', '[tlsc_wizard configurator=\"blind\"]', true );\nflush_rewrite_rules();\n" 39 48 }, 40 49 {
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)