Plugin Directory

Changeset 3397857

Timestamp:
11/18/2025 08:51:00 AM (6 days ago)
Author:
acowebscd
Message:

Update to version 1.2.4

Location:
deposits-partial-payments-for-woocommerce
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • deposits-partial-payments-for-woocommerce/assets/blueprints/blueprint.json

    r3388611 r3397857  
    3232    {
    3333      "step": "runPHP",
     34      "code": "<?php $mu_dir='/wordpress/wp-content/mu-plugins';if(!is_dir($mu_dir))mkdir($mu_dir,0777,true);file_put_contents($mu_dir.'/disable-wc-admin.php','<?php add_filter(\\'woocommerce_admin_disabled\\',\\'__return_true\\'); add_filter(\\'woocommerce_task_list_enabled\\',\\'__return_false\\'); add_filter(\\'woocommerce_admin_features\\',\\'__return_empty_array\\');');?>"
     35    },
     36    {
     37      "step": "runPHP",
    3438      "code": "<?php\nrequire_once 'wordpress/wp-load.php';\n\n// Step 1: Disable WooCommerce guided setup wizard\nupdate_option('woocommerce_task_list_hidden', 'yes');\nupdate_option('woocommerce_setup_wizard_completed', 'yes');\n\necho 'WooCommerce guided setup disabled.';\n\n// Step 2: Create Cart page with [woocommerce_cart] shortcode\n$cart_page = array(\n    'post_title' => 'Cart',\n    'post_content' => '[woocommerce_cart]',\n    'post_status' => 'publish',\n    'post_type' => 'page'\n);\n$cart_page_id = wp_insert_post($cart_page);\n\nif ($cart_page_id) {\n    update_option('woocommerce_cart_page_id', $cart_page_id);\n    echo 'Cart page created with ID: ' . $cart_page_id . '.';\n} else {\n    echo 'Failed to create Cart page.';\n}\n\n// Step 3: Create Checkout page with [woocommerce_checkout] shortcode\n$checkout_page = array(\n    'post_title' => 'Checkout',\n    'post_content' => '[woocommerce_checkout]',\n    'post_status' => 'publish',\n    'post_type' => 'page'\n);\n$checkout_page_id = wp_insert_post($checkout_page);\n\nif ($checkout_page_id) {\n    // Set as WooCommerce checkout page\n    update_option('woocommerce_checkout_page_id', $checkout_page_id);\n    // Force shortcode-based checkout (disable block-based)\n    update_option('woocommerce_checkout_page_template', 'default');\n    echo 'Checkout page created with ID: ' . $checkout_page_id . '.';\n} else {\n    echo 'Failed to create Checkout page.';\n}\n\n// Step 4: Create a simple WooCommerce product\n$product_data = array(\n    'post_title' => 'Sample T-Shirt',\n    'post_content' => 'A comfortable and stylish t-shirt for everyday wear.',\n    'post_status' => 'publish',\n    'post_type' => 'product'\n);\n$product_id = wp_insert_post($product_data);\n\nif ($product_id) {\n    // Set product type and attributes\n    wp_set_object_terms($product_id, 'simple', 'product_type');\n    update_post_meta($product_id, '_regular_price', '100.00');\n    update_post_meta($product_id, '_price', '100.00');\n    update_post_meta($product_id, '_stock_status', 'instock');\n    update_post_meta($product_id, '_manage_stock', 'no');\n\n    echo 'Sample product created with ID: ' . $product_id . '.';\n} else {\n    echo 'Failed to create sample product.';\n}\n\necho ' | Shortcode-based Cart and Checkout pages configured successfully.';\n?>"
    3539    },
Note: See TracChangeset for help on using the changeset viewer.