From a8ede367aed6755c01b6b9c1933bf17e68abbbf5 Mon Sep 17 00:00:00 2001 From: Calvin Rodrigues Date: Tue, 10 Dec 2024 15:13:23 +0530 Subject: [PATCH] =?UTF-8?q?Add=20WooCommerce=20demo=20blueprint=20with=20c?= =?UTF-8?q?ustom=20flat=20rate=20shipping=20and=20pro=E2=80=A6=20(#62)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## WooCommerce Custom Flat Rate Shipping Demo Blueprint - Configured WordPress Playground instance to install WooCommerce. - Added custom flat rate shipping method via plugin. - Imported a product for demonstrating shipping on cart/checkout pages. --------- Co-authored-by: Bero --- blueprints/woo-shipping/blueprint.json | 52 + blueprints/woo-shipping/sample_products.xml | 4854 +++++++++++++++++ .../woo-shipping-method.php | 68 + 3 files changed, 4974 insertions(+) create mode 100644 blueprints/woo-shipping/blueprint.json create mode 100644 blueprints/woo-shipping/sample_products.xml create mode 100644 blueprints/woo-shipping/woo-shipping-method/woo-shipping-method.php diff --git a/blueprints/woo-shipping/blueprint.json b/blueprints/woo-shipping/blueprint.json new file mode 100644 index 0000000..57d680b --- /dev/null +++ b/blueprints/woo-shipping/blueprint.json @@ -0,0 +1,52 @@ +{ + "$schema": "https://playground.wordpress.net/blueprint-schema.json", + "meta": { + "title": "Minimal WooCommerce Setup with Sample Products, Shipping, and Payment Method", + "description": "To create a WordPress Playground instance that installs WooCommerce, adds a custom flat rate shipping method via a plugin, imports WooCommerce sample products XML to demonstrate the shipping method on the cart/checkout pages, and enables the Direct Bank Transfer payment method.", + "author": "calvinrodrigues500", + "categories": [ + "woocommerce", + "shipping", + "flat_rate" + ] + }, + "steps": [ + { + "step": "setSiteOptions", + "options": { + "blogName": "Woo Shipping Method" + } + }, + { + "step": "installPlugin", + "pluginZipFile": { + "resource": "wordpress.org/plugins", + "slug": "woocommerce" + } + }, + { + "step": "importWxr", + "file": { + "resource": "url", + "url": "https://raw.githubusercontent.com/calvinrodrigues500/blueprints/woo-shipping/blueprints/woo-shipping/sample_products.xml" + } + }, + { + "step": "mkdir", + "path": "/wordpress/wp-content/plugins/woo-shipping-method" + }, + { + "step": "writeFile", + "path": "/wordpress/wp-content/plugins/woo-shipping-method/woo-shipping-method.php", + "data": { + "resource": "url", + "url": "https://raw.githubusercontent.com/calvinrodrigues500/blueprints/woo-shipping/blueprints/woo-shipping/woo-shipping-method/woo-shipping-method.php" + } + }, + { + "step": "activatePlugin", + "pluginName": "woo-shipping-method", + "pluginPath": "woo-shipping-method/woo-shipping-method.php" + } + ] +} \ No newline at end of file diff --git a/blueprints/woo-shipping/sample_products.xml b/blueprints/woo-shipping/sample_products.xml new file mode 100644 index 0000000..b9b07b4 --- /dev/null +++ b/blueprints/woo-shipping/sample_products.xml @@ -0,0 +1,4854 @@ + + + + + +WooCommerce Demo Store +http: +Just another WooCommerce store +Wed, 16 Jan 2019 13:09:24 +0000 +en-US +1.2 +http: +http: + + 1 + shopmanager + info@woocommerce.com + + + + +https://wordpress.org/?v=5.0.3 + + V-Neck T-Shirt + https://woocommercecore.mystagingwebsite.com/product/v-neck-t-shirt/ + Wed, 16 Jan 2019 13:01:52 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/product/v-neck-t-shirt/ + + + + 6 + 2019-01-16 13:01:52 + 2019-01-16 13:01:52 + open + closed + v-neck-t-shirt + publish + 0 + 0 + product + + 0 + + + + + + + + + + + _sku + + + + _sale_price_dates_from + + + + _sale_price_dates_to + + + + total_sales + + + + _tax_status + + + + _tax_class + + + + _manage_stock + + + + _backorders + + + + _low_stock_amount + + + + _sold_individually + + + + + + + + + + + + + + + + + + + + _upsell_ids + + + + _crosssell_ids + + + + _purchase_note + + + + _default_attributes + + + + _virtual + + + + _downloadable + + + + _product_image_gallery + + + + _download_limit + + + + _download_expiry + + + + _stock + + + + _stock_status + + + + _wc_average_rating + + + + _wc_rating_count + + + + _wc_review_count + + + + _downloadable_files + + + + _product_attributes + + + + _product_version + + + + _thumbnail_id + + + + _price + + + + _price + + + + _regular_price + + + + _sale_price + + + + + Hoodie + https://woocommercecore.mystagingwebsite.com/product/hoodie/ + Wed, 16 Jan 2019 13:01:52 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/product/hoodie/ + + + + 7 + 2019-01-16 13:01:52 + 2019-01-16 13:01:52 + open + closed + hoodie + publish + 0 + 0 + product + + 0 + + + + + + + _sku + + + + _sale_price_dates_from + + + + _sale_price_dates_to + + + + total_sales + + + + _tax_status + + + + _tax_class + + + + _manage_stock + + + + _backorders + + + + _low_stock_amount + + + + _sold_individually + + + + + + + + + + + + + + + + + + + + _upsell_ids + + + + _crosssell_ids + + + + _purchase_note + + + + _default_attributes + + + + _virtual + + + + _downloadable + + + + _product_image_gallery + + + + _download_limit + + + + _download_expiry + + + + _stock + + + + _stock_status + + + + _wc_average_rating + + + + _wc_rating_count + + + + _wc_review_count + + + + _downloadable_files + + + + _product_attributes + + + + _product_version + + + + _thumbnail_id + + + + _price + + + + _price + + + + _regular_price + + + + _sale_price + + + + + Hoodie with Logo + https://woocommercecore.mystagingwebsite.com/product/hoodie-with-logo/ + Wed, 16 Jan 2019 13:01:52 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/product/hoodie-with-logo/ + + + + 8 + 2019-01-16 13:01:52 + 2019-01-16 13:01:52 + open + closed + hoodie-with-logo + publish + 0 + 0 + product + + 0 + + + + + _sku + + + + _regular_price + + + + _sale_price + + + + _sale_price_dates_from + + + + _sale_price_dates_to + + + + total_sales + + + + _tax_status + + + + _tax_class + + + + _manage_stock + + + + _backorders + + + + _low_stock_amount + + + + _sold_individually + + + + + + + + + + + + + + + + + + + + _upsell_ids + + + + _crosssell_ids + + + + _purchase_note + + + + _default_attributes + + + + _virtual + + + + _downloadable + + + + _product_image_gallery + + + + _download_limit + + + + _download_expiry + + + + _stock + + + + _stock_status + + + + _wc_average_rating + + + + _wc_rating_count + + + + _wc_review_count + + + + _downloadable_files + + + + _product_attributes + + + + _product_version + + + + _price + + + + _thumbnail_id + + + + + T-Shirt + https://woocommercecore.mystagingwebsite.com/product/t-shirt/ + Wed, 16 Jan 2019 13:01:52 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/product/t-shirt/ + + + + 9 + 2019-01-16 13:01:52 + 2019-01-16 13:01:52 + open + closed + t-shirt + publish + 0 + 0 + product + + 0 + + + + + _sku + + + + _regular_price + + + + _sale_price + + + + _sale_price_dates_from + + + + _sale_price_dates_to + + + + total_sales + + + + _tax_status + + + + _tax_class + + + + _manage_stock + + + + _backorders + + + + _low_stock_amount + + + + _sold_individually + + + + + + + + + + + + + + + + + + + + _upsell_ids + + + + _crosssell_ids + + + + _purchase_note + + + + _default_attributes + + + + _virtual + + + + _downloadable + + + + _product_image_gallery + + + + _download_limit + + + + _download_expiry + + + + _stock + + + + _stock_status + + + + _wc_average_rating + + + + _wc_rating_count + + + + _wc_review_count + + + + _downloadable_files + + + + _product_attributes + + + + _product_version + + + + _price + + + + _thumbnail_id + + + + + Beanie + https://woocommercecore.mystagingwebsite.com/product/beanie/ + Wed, 16 Jan 2019 13:01:52 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/product/beanie/ + + + + 10 + 2019-01-16 13:01:52 + 2019-01-16 13:01:52 + open + closed + beanie + publish + 0 + 0 + product + + 0 + + + + + _sku + + + + _regular_price + + + + _sale_price + + + + _sale_price_dates_from + + + + _sale_price_dates_to + + + + total_sales + + + + _tax_status + + + + _tax_class + + + + _manage_stock + + + + _backorders + + + + _low_stock_amount + + + + _sold_individually + + + + + + + + + + + + + + + + + + + + _upsell_ids + + + + _crosssell_ids + + + + _purchase_note + + + + _default_attributes + + + + _virtual + + + + _downloadable + + + + _product_image_gallery + + + + _download_limit + + + + _download_expiry + + + + _stock + + + + _stock_status + + + + _wc_average_rating + + + + _wc_rating_count + + + + _wc_review_count + + + + _downloadable_files + + + + _product_attributes + + + + _product_version + + + + _price + + + + _thumbnail_id + + + + + Belt + https://woocommercecore.mystagingwebsite.com/product/belt/ + Wed, 16 Jan 2019 13:01:52 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/product/belt/ + + + + 11 + 2019-01-16 13:01:52 + 2019-01-16 13:01:52 + open + closed + belt + publish + 0 + 0 + product + + 0 + + + + _sku + + + + _regular_price + + + + _sale_price + + + + _sale_price_dates_from + + + + _sale_price_dates_to + + + + total_sales + + + + _tax_status + + + + _tax_class + + + + _manage_stock + + + + _backorders + + + + _low_stock_amount + + + + _sold_individually + + + + + + + + + + + + + + + + + + + + _upsell_ids + + + + _crosssell_ids + + + + _purchase_note + + + + _default_attributes + + + + _virtual + + + + _downloadable + + + + _product_image_gallery + + + + _download_limit + + + + _download_expiry + + + + _stock + + + + _stock_status + + + + _wc_average_rating + + + + _wc_rating_count + + + + _wc_review_count + + + + _downloadable_files + + + + _product_attributes + + + + _product_version + + + + _price + + + + _thumbnail_id + + + + + Cap + https://woocommercecore.mystagingwebsite.com/product/cap/ + Wed, 16 Jan 2019 13:01:53 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/product/cap/ + + + + 12 + 2019-01-16 13:01:53 + 2019-01-16 13:01:53 + open + closed + cap + publish + 0 + 0 + product + + 0 + + + + + + _sku + + + + _regular_price + + + + _sale_price + + + + _sale_price_dates_from + + + + _sale_price_dates_to + + + + total_sales + + + + _tax_status + + + + _tax_class + + + + _manage_stock + + + + _backorders + + + + _low_stock_amount + + + + _sold_individually + + + + + + + + + + + + + + + + + + + + _upsell_ids + + + + _crosssell_ids + + + + _purchase_note + + + + _default_attributes + + + + _virtual + + + + _downloadable + + + + _product_image_gallery + + + + _download_limit + + + + _download_expiry + + + + _stock + + + + _stock_status + + + + _wc_average_rating + + + + _wc_rating_count + + + + _wc_review_count + + + + _downloadable_files + + + + _product_attributes + + + + _product_version + + + + _price + + + + _thumbnail_id + + + + + Sunglasses + https://woocommercecore.mystagingwebsite.com/product/sunglasses/ + Wed, 16 Jan 2019 13:01:53 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/product/sunglasses/ + + + + 13 + 2019-01-16 13:01:53 + 2019-01-16 13:01:53 + open + closed + sunglasses + publish + 0 + 0 + product + + 0 + + + + + _sku + + + + _regular_price + + + + _sale_price + + + + _sale_price_dates_from + + + + _sale_price_dates_to + + + + total_sales + + + + _tax_status + + + + _tax_class + + + + _manage_stock + + + + _backorders + + + + _low_stock_amount + + + + _sold_individually + + + + + + + + + + + + + + + + + + + + _upsell_ids + + + + _crosssell_ids + + + + _purchase_note + + + + _default_attributes + + + + _virtual + + + + _downloadable + + + + _product_image_gallery + + + + _download_limit + + + + _download_expiry + + + + _stock + + + + _stock_status + + + + _wc_average_rating + + + + _wc_rating_count + + + + _wc_review_count + + + + _downloadable_files + + + + _product_attributes + + + + _product_version + + + + _price + + + + _thumbnail_id + + + + + Hoodie with Pocket + https://woocommercecore.mystagingwebsite.com/product/hoodie-with-pocket/ + Wed, 16 Jan 2019 13:01:53 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/product/hoodie-with-pocket/ + + + + 14 + 2019-01-16 13:01:53 + 2019-01-16 13:01:53 + open + closed + hoodie-with-pocket + publish + 0 + 0 + product + + 0 + + + + + + + + _sku + + + + _regular_price + + + + _sale_price + + + + _sale_price_dates_from + + + + _sale_price_dates_to + + + + total_sales + + + + _tax_status + + + + _tax_class + + + + _manage_stock + + + + _backorders + + + + _low_stock_amount + + + + _sold_individually + + + + + + + + + + + + + + + + + + + + _upsell_ids + + + + _crosssell_ids + + + + _purchase_note + + + + _default_attributes + + + + _virtual + + + + _downloadable + + + + _product_image_gallery + + + + _download_limit + + + + _download_expiry + + + + _stock + + + + _stock_status + + + + _wc_average_rating + + + + _wc_rating_count + + + + _wc_review_count + + + + _downloadable_files + + + + _product_attributes + + + + _product_version + + + + _price + + + + _thumbnail_id + + + + + Hoodie with Zipper + https://woocommercecore.mystagingwebsite.com/product/hoodie-with-zipper/ + Wed, 16 Jan 2019 13:01:53 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/product/hoodie-with-zipper/ + + + + 15 + 2019-01-16 13:01:53 + 2019-01-16 13:01:53 + open + closed + hoodie-with-zipper + publish + 0 + 0 + product + + 0 + + + + + _sku + + + + _regular_price + + + + _sale_price + + + + _sale_price_dates_from + + + + _sale_price_dates_to + + + + total_sales + + + + _tax_status + + + + _tax_class + + + + _manage_stock + + + + _backorders + + + + _low_stock_amount + + + + _sold_individually + + + + + + + + + + + + + + + + + + + + _upsell_ids + + + + _crosssell_ids + + + + _purchase_note + + + + _default_attributes + + + + _virtual + + + + _downloadable + + + + _product_image_gallery + + + + _download_limit + + + + _download_expiry + + + + _stock + + + + _stock_status + + + + _wc_average_rating + + + + _wc_rating_count + + + + _wc_review_count + + + + _downloadable_files + + + + _product_attributes + + + + _product_version + + + + _price + + + + _thumbnail_id + + + + + Long Sleeve Tee + https://woocommercecore.mystagingwebsite.com/product/long-sleeve-tee/ + Wed, 16 Jan 2019 13:01:53 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/product/long-sleeve-tee/ + + + + 16 + 2019-01-16 13:01:53 + 2019-01-16 13:01:53 + open + closed + long-sleeve-tee + publish + 0 + 0 + product + + 0 + + + + + _sku + + + + _regular_price + + + + _sale_price + + + + _sale_price_dates_from + + + + _sale_price_dates_to + + + + total_sales + + + + _tax_status + + + + _tax_class + + + + _manage_stock + + + + _backorders + + + + _low_stock_amount + + + + _sold_individually + + + + + + + + + + + + + + + + + + + + _upsell_ids + + + + _crosssell_ids + + + + _purchase_note + + + + _default_attributes + + + + _virtual + + + + _downloadable + + + + _product_image_gallery + + + + _download_limit + + + + _download_expiry + + + + _stock + + + + _stock_status + + + + _wc_average_rating + + + + _wc_rating_count + + + + _wc_review_count + + + + _downloadable_files + + + + _product_attributes + + + + _product_version + + + + _price + + + + _thumbnail_id + + + + + Polo + https://woocommercecore.mystagingwebsite.com/product/polo/ + Wed, 16 Jan 2019 13:01:53 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/product/polo/ + + + + 17 + 2019-01-16 13:01:53 + 2019-01-16 13:01:53 + open + closed + polo + publish + 0 + 0 + product + + 0 + + + + + _sku + + + + _regular_price + + + + _sale_price + + + + _sale_price_dates_from + + + + _sale_price_dates_to + + + + total_sales + + + + _tax_status + + + + _tax_class + + + + _manage_stock + + + + _backorders + + + + _low_stock_amount + + + + _sold_individually + + + + + + + + + + + + + + + + + + + + _upsell_ids + + + + _crosssell_ids + + + + _purchase_note + + + + _default_attributes + + + + _virtual + + + + _downloadable + + + + _product_image_gallery + + + + _download_limit + + + + _download_expiry + + + + _stock + + + + _stock_status + + + + _wc_average_rating + + + + _wc_rating_count + + + + _wc_review_count + + + + _downloadable_files + + + + _product_attributes + + + + _product_version + + + + _price + + + + _thumbnail_id + + + + + Album + https://woocommercecore.mystagingwebsite.com/product/album/ + Wed, 16 Jan 2019 13:01:54 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/product/album/ + + + + 18 + 2019-01-16 13:01:54 + 2019-01-16 13:01:54 + open + closed + album + publish + 0 + 0 + product + + 0 + + + + _sku + + + + _regular_price + + + + _sale_price + + + + _sale_price_dates_from + + + + _sale_price_dates_to + + + + total_sales + + + + _tax_status + + + + _tax_class + + + + _manage_stock + + + + _backorders + + + + _low_stock_amount + + + + _sold_individually + + + + _weight + + + + _length + + + + _width + + + + _height + + + + _upsell_ids + + + + _crosssell_ids + + + + _purchase_note + + + + _default_attributes + + + + _virtual + + + + _downloadable + + + + _product_image_gallery + + + + _download_limit + + + + _download_expiry + + + + _stock + + + + _stock_status + + + + _wc_average_rating + + + + _wc_rating_count + + + + _wc_review_count + + + + _downloadable_files + + + + _product_attributes + + + + _product_version + + + + _price + + + + _thumbnail_id + + + + + Single + https://woocommercecore.mystagingwebsite.com/product/single/ + Wed, 16 Jan 2019 13:01:54 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/product/single/ + + + + 19 + 2019-01-16 13:01:54 + 2019-01-16 13:01:54 + open + closed + single + publish + 0 + 0 + product + + 0 + + + + _sku + + + + _regular_price + + + + _sale_price + + + + _sale_price_dates_from + + + + _sale_price_dates_to + + + + total_sales + + + + _tax_status + + + + _tax_class + + + + _manage_stock + + + + _backorders + + + + _low_stock_amount + + + + _sold_individually + + + + _weight + + + + _length + + + + _width + + + + _height + + + + _upsell_ids + + + + _crosssell_ids + + + + _purchase_note + + + + _default_attributes + + + + _virtual + + + + _downloadable + + + + _product_image_gallery + + + + _download_limit + + + + _download_expiry + + + + _stock + + + + _stock_status + + + + _wc_average_rating + + + + _wc_rating_count + + + + _wc_review_count + + + + _downloadable_files + + + + _product_attributes + + + + _product_version + + + + _price + + + + _thumbnail_id + + + + + V-Neck T-Shirt - Red + https://woocommercecore.mystagingwebsite.com/product/v-neck-t-shirt/?attribute_pa_color=red + Wed, 16 Jan 2019 13:01:54 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/product/v-neck-t-shirt-red/ + + + + 20 + 2019-01-16 13:01:54 + 2019-01-16 13:01:54 + closed + closed + v-neck-t-shirt-red + publish + 6 + 0 + product_variation + + 0 + + _sku + + + + _regular_price + + + + _sale_price + + + + _sale_price_dates_from + + + + _sale_price_dates_to + + + + total_sales + + + + _tax_status + + + + _tax_class + + + + _manage_stock + + + + _backorders + + + + _low_stock_amount + + + + _sold_individually + + + + _weight + + + + _length + + + + _width + + + + _height + + + + _upsell_ids + + + + _crosssell_ids + + + + _purchase_note + + + + _default_attributes + + + + _virtual + + + + _downloadable + + + + _product_image_gallery + + + + _download_limit + + + + _download_expiry + + + + _stock + + + + _stock_status + + + + _wc_average_rating + + + + _wc_rating_count + + + + _wc_review_count + + + + _downloadable_files + + + + _product_attributes + + + + _product_version + + + + _price + + + + _variation_description + + + + _thumbnail_id + + + + attribute_pa_color + + + + attribute_pa_size + + + + + V-Neck T-Shirt - Green + https://woocommercecore.mystagingwebsite.com/product/v-neck-t-shirt/?attribute_pa_color=green + Wed, 16 Jan 2019 13:01:54 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/product/v-neck-t-shirt-green/ + + + + 21 + 2019-01-16 13:01:54 + 2019-01-16 13:01:54 + closed + closed + v-neck-t-shirt-green + publish + 6 + 0 + product_variation + + 0 + + _sku + + + + _regular_price + + + + _sale_price + + + + _sale_price_dates_from + + + + _sale_price_dates_to + + + + total_sales + + + + _tax_status + + + + _tax_class + + + + _manage_stock + + + + _backorders + + + + _low_stock_amount + + + + _sold_individually + + + + _weight + + + + _length + + + + _width + + + + _height + + + + _upsell_ids + + + + _crosssell_ids + + + + _purchase_note + + + + _default_attributes + + + + _virtual + + + + _downloadable + + + + _product_image_gallery + + + + _download_limit + + + + _download_expiry + + + + _stock + + + + _stock_status + + + + _wc_average_rating + + + + _wc_rating_count + + + + _wc_review_count + + + + _downloadable_files + + + + _product_attributes + + + + _product_version + + + + _price + + + + _variation_description + + + + _thumbnail_id + + + + attribute_pa_color + + + + attribute_pa_size + + + + + V-Neck T-Shirt - Blue + https://woocommercecore.mystagingwebsite.com/product/v-neck-t-shirt/?attribute_pa_color=blue + Wed, 16 Jan 2019 13:01:54 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/product/v-neck-t-shirt-blue/ + + + + 22 + 2019-01-16 13:01:54 + 2019-01-16 13:01:54 + closed + closed + v-neck-t-shirt-blue + publish + 6 + 0 + product_variation + + 0 + + _sku + + + + _regular_price + + + + _sale_price + + + + _sale_price_dates_from + + + + _sale_price_dates_to + + + + total_sales + + + + _tax_status + + + + _tax_class + + + + _manage_stock + + + + _backorders + + + + _low_stock_amount + + + + _sold_individually + + + + _weight + + + + _length + + + + _width + + + + _height + + + + _upsell_ids + + + + _crosssell_ids + + + + _purchase_note + + + + _default_attributes + + + + _virtual + + + + _downloadable + + + + _product_image_gallery + + + + _download_limit + + + + _download_expiry + + + + _stock + + + + _stock_status + + + + _wc_average_rating + + + + _wc_rating_count + + + + _wc_review_count + + + + _downloadable_files + + + + _product_attributes + + + + _product_version + + + + _price + + + + _wpcom_is_markdown + + + + _wp_old_slug + + + + _variation_description + + + + _thumbnail_id + + + + attribute_pa_color + + + + attribute_pa_size + + + + + Hoodie - Red, No + https://woocommercecore.mystagingwebsite.com/product/hoodie/?attribute_pa_color=red&attribute_logo=no + Wed, 16 Jan 2019 13:01:54 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/product/hoodie-red-no + + + + 23 + 2019-01-16 13:01:54 + 2019-01-16 13:01:54 + closed + closed + hoodie-red-no + publish + 7 + 1 + product_variation + + 0 + + _sku + + + + _regular_price + + + + _sale_price + + + + _sale_price_dates_from + + + + _sale_price_dates_to + + + + total_sales + + + + _tax_status + + + + _tax_class + + + + _manage_stock + + + + _backorders + + + + _low_stock_amount + + + + _sold_individually + + + + _weight + + + + _length + + + + _width + + + + _height + + + + _upsell_ids + + + + _crosssell_ids + + + + _purchase_note + + + + _default_attributes + + + + _virtual + + + + _downloadable + + + + _product_image_gallery + + + + _download_limit + + + + _download_expiry + + + + _stock + + + + _stock_status + + + + _wc_average_rating + + + + _wc_rating_count + + + + _wc_review_count + + + + _downloadable_files + + + + _product_attributes + + + + _product_version + + + + _price + + + + _variation_description + + + + _thumbnail_id + + + + attribute_pa_color + + + + attribute_logo + + + + + Hoodie - Green, No + https://woocommercecore.mystagingwebsite.com/product/hoodie/?attribute_pa_color=green&attribute_logo=No + Wed, 16 Jan 2019 13:01:54 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/product/hoodie-green-no/ + + + + 24 + 2019-01-16 13:01:54 + 2019-01-16 13:01:54 + closed + closed + hoodie-green-no + publish + 7 + 2 + product_variation + + 0 + + _sku + + + + _regular_price + + + + _sale_price + + + + _sale_price_dates_from + + + + _sale_price_dates_to + + + + total_sales + + + + _tax_status + + + + _tax_class + + + + _manage_stock + + + + _backorders + + + + _low_stock_amount + + + + _sold_individually + + + + _weight + + + + _length + + + + _width + + + + _height + + + + _upsell_ids + + + + _crosssell_ids + + + + _purchase_note + + + + _default_attributes + + + + _virtual + + + + _downloadable + + + + _product_image_gallery + + + + _download_limit + + + + _download_expiry + + + + _stock + + + + _stock_status + + + + _wc_average_rating + + + + _wc_rating_count + + + + _wc_review_count + + + + _downloadable_files + + + + _product_attributes + + + + _product_version + + + + _price + + + + _variation_description + + + + _thumbnail_id + + + + attribute_pa_color + + + + attribute_logo + + + + + Hoodie - Blue, No + https://woocommercecore.mystagingwebsite.com/product/hoodie/?attribute_pa_color=blue&attribute_logo=No + Wed, 16 Jan 2019 13:01:55 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/product/hoodie-blue-no + + + + 25 + 2019-01-16 13:01:55 + 2019-01-16 13:01:55 + closed + closed + hoodie-blue-no + publish + 7 + 3 + product_variation + + 0 + + _sku + + + + _regular_price + + + + _sale_price + + + + _sale_price_dates_from + + + + _sale_price_dates_to + + + + total_sales + + + + _tax_status + + + + _tax_class + + + + _manage_stock + + + + _backorders + + + + _low_stock_amount + + + + _sold_individually + + + + _weight + + + + _length + + + + _width + + + + _height + + + + _upsell_ids + + + + _crosssell_ids + + + + _purchase_note + + + + _default_attributes + + + + _virtual + + + + _downloadable + + + + _product_image_gallery + + + + _download_limit + + + + _download_expiry + + + + _stock + + + + _stock_status + + + + _wc_average_rating + + + + _wc_rating_count + + + + _wc_review_count + + + + _downloadable_files + + + + _product_attributes + + + + _product_version + + + + _price + + + + _variation_description + + + + _thumbnail_id + + + + attribute_pa_color + + + + attribute_logo + + + + + T-Shirt with Logo + https://woocommercecore.mystagingwebsite.com/product/t-shirt-with-logo/ + Wed, 16 Jan 2019 13:01:55 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/product/t-shirt-with-logo/ + + + + 26 + 2019-01-16 13:01:55 + 2019-01-16 13:01:55 + open + closed + t-shirt-with-logo + publish + 0 + 0 + product + + 0 + + + + + _sku + + + + _regular_price + + + + _sale_price + + + + _sale_price_dates_from + + + + _sale_price_dates_to + + + + total_sales + + + + _tax_status + + + + _tax_class + + + + _manage_stock + + + + _backorders + + + + _low_stock_amount + + + + _sold_individually + + + + + + + + + + + + + + + + + + + + _upsell_ids + + + + _crosssell_ids + + + + _purchase_note + + + + _default_attributes + + + + _virtual + + + + _downloadable + + + + _product_image_gallery + + + + _download_limit + + + + _download_expiry + + + + _stock + + + + _stock_status + + + + _wc_average_rating + + + + _wc_rating_count + + + + _wc_review_count + + + + _downloadable_files + + + + _product_attributes + + + + _product_version + + + + _price + + + + _thumbnail_id + + + + + Beanie with Logo + https://woocommercecore.mystagingwebsite.com/product/beanie-with-logo/ + Wed, 16 Jan 2019 13:01:55 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/product/beanie-with-logo/ + + + + 27 + 2019-01-16 13:01:55 + 2019-01-16 13:01:55 + open + closed + beanie-with-logo + publish + 0 + 0 + product + + 0 + + + + + _sku + + + + _regular_price + + + + _sale_price + + + + _sale_price_dates_from + + + + _sale_price_dates_to + + + + total_sales + + + + _tax_status + + + + _tax_class + + + + _manage_stock + + + + _backorders + + + + _low_stock_amount + + + + _sold_individually + + + + + + + + + + + + + + + + + + + + _upsell_ids + + + + _crosssell_ids + + + + _purchase_note + + + + _default_attributes + + + + _virtual + + + + _downloadable + + + + _product_image_gallery + + + + _download_limit + + + + _download_expiry + + + + _stock + + + + _stock_status + + + + _wc_average_rating + + + + _wc_rating_count + + + + _wc_review_count + + + + _downloadable_files + + + + _product_attributes + + + + _product_version + + + + _price + + + + _thumbnail_id + + + + + Logo Collection + https://woocommercecore.mystagingwebsite.com/product/logo-collection/ + Wed, 16 Jan 2019 13:01:55 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/product/logo-collection/ + + + + 28 + 2019-01-16 13:01:55 + 2019-01-16 13:01:55 + open + closed + logo-collection + publish + 0 + 0 + product + + 0 + + + + _sku + + + + _sale_price_dates_from + + + + _sale_price_dates_to + + + + total_sales + + + + _tax_status + + + + _tax_class + + + + _manage_stock + + + + _backorders + + + + _low_stock_amount + + + + _sold_individually + + + + _weight + + + + _length + + + + _width + + + + _height + + + + _upsell_ids + + + + _crosssell_ids + + + + _purchase_note + + + + _default_attributes + + + + _virtual + + + + _downloadable + + + + _product_image_gallery + + + + _download_limit + + + + _download_expiry + + + + _stock + + + + _stock_status + + + + _wc_average_rating + + + + _wc_rating_count + + + + _wc_review_count + + + + _downloadable_files + + + + _product_attributes + + + + _product_version + + + + _children + + + + _thumbnail_id + + + + _price + + + + _price + + + + + WordPress Pennant + https://woocommercecore.mystagingwebsite.com/product/wordpress-pennant/ + Wed, 16 Jan 2019 13:01:55 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/product/wordpress-pennant/ + + + + 29 + 2019-01-16 13:01:55 + 2019-01-16 13:01:55 + open + closed + wordpress-pennant + publish + 0 + 0 + product + + 0 + + + + _sku + + + + _regular_price + + + + _sale_price + + + + _sale_price_dates_from + + + + _sale_price_dates_to + + + + total_sales + + + + _tax_status + + + + _tax_class + + + + _manage_stock + + + + _backorders + + + + _low_stock_amount + + + + _sold_individually + + + + _weight + + + + _length + + + + _width + + + + _height + + + + _upsell_ids + + + + _crosssell_ids + + + + _purchase_note + + + + _default_attributes + + + + _virtual + + + + _downloadable + + + + _product_image_gallery + + + + _download_limit + + + + _download_expiry + + + + _stock + + + + _stock_status + + + + _wc_average_rating + + + + _wc_rating_count + + + + _wc_review_count + + + + _downloadable_files + + + + _product_attributes + + + + _product_version + + + + _price + + + + _thumbnail_id + + + + _product_url + + + + _button_text + + + + + Hoodie - Blue, Yes + https://woocommercecore.mystagingwebsite.com/product/hoodie/?attribute_pa_color=blue&attribute_logo=Yes + Wed, 16 Jan 2019 13:01:55 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/product/hoodie-blue-yes/ + + + + 30 + 2019-01-16 13:01:55 + 2019-01-16 13:01:55 + closed + closed + hoodie-blue-yes + publish + 7 + 0 + product_variation + + 0 + + _sku + + + + _regular_price + + + + _sale_price + + + + _sale_price_dates_from + + + + _sale_price_dates_to + + + + total_sales + + + + _tax_status + + + + _tax_class + + + + _manage_stock + + + + _backorders + + + + _low_stock_amount + + + + _sold_individually + + + + _weight + + + + _length + + + + _width + + + + _height + + + + _upsell_ids + + + + _crosssell_ids + + + + _purchase_note + + + + _default_attributes + + + + _virtual + + + + _downloadable + + + + _product_image_gallery + + + + _download_limit + + + + _download_expiry + + + + _stock + + + + _stock_status + + + + _wc_average_rating + + + + _wc_rating_count + + + + _wc_review_count + + + + _downloadable_files + + + + _product_attributes + + + + _product_version + + + + _price + + + + _variation_description + + + + _thumbnail_id + + + + attribute_pa_color + + + + attribute_logo + + + + + vneck-tee-2.jpg + https://woocommercecore.mystagingwebsite.com/?attachment_id=31 + Wed, 16 Jan 2019 13:01:56 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/vneck-tee-2.jpg + + + + 31 + 2019-01-16 13:01:56 + 2019-01-16 13:01:56 + open + closed + vneck-tee-2-jpg + inherit + 6 + 0 + attachment + + 0 + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/vneck-tee-2.jpg + + _wc_attachment_source + + + + + vnech-tee-green-1.jpg + https://woocommercecore.mystagingwebsite.com/?attachment_id=32 + Wed, 16 Jan 2019 13:01:57 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/vnech-tee-green-1.jpg + + + + 32 + 2019-01-16 13:01:57 + 2019-01-16 13:01:57 + open + closed + vnech-tee-green-1-jpg + inherit + 6 + 0 + attachment + + 0 + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/vnech-tee-green-1.jpg + + _wc_attachment_source + + + + + vnech-tee-blue-1.jpg + https://woocommercecore.mystagingwebsite.com/?attachment_id=33 + Wed, 16 Jan 2019 13:01:58 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/vnech-tee-blue-1.jpg + + + + 33 + 2019-01-16 13:01:58 + 2019-01-16 13:01:58 + open + closed + vnech-tee-blue-1-jpg + inherit + 6 + 0 + attachment + + 0 + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/vnech-tee-blue-1.jpg + + _wc_attachment_source + + + + + hoodie-2.jpg + https://woocommercecore.mystagingwebsite.com/?attachment_id=34 + Wed, 16 Jan 2019 13:01:58 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/hoodie-2.jpg + + + + 34 + 2019-01-16 13:01:58 + 2019-01-16 13:01:58 + open + closed + hoodie-2-jpg + inherit + 7 + 0 + attachment + + 0 + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/hoodie-2.jpg + + _wc_attachment_source + + + + + hoodie-blue-1.jpg + https://woocommercecore.mystagingwebsite.com/?attachment_id=35 + Wed, 16 Jan 2019 13:01:59 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/hoodie-blue-1.jpg + + + + 35 + 2019-01-16 13:01:59 + 2019-01-16 13:01:59 + open + closed + hoodie-blue-1-jpg + inherit + 7 + 0 + attachment + + 0 + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/hoodie-blue-1.jpg + + _wc_attachment_source + + + + + hoodie-green-1.jpg + https://woocommercecore.mystagingwebsite.com/?attachment_id=36 + Wed, 16 Jan 2019 13:02:00 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/hoodie-green-1.jpg + + + + 36 + 2019-01-16 13:02:00 + 2019-01-16 13:02:00 + open + closed + hoodie-green-1-jpg + inherit + 7 + 0 + attachment + + 0 + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/hoodie-green-1.jpg + + _wc_attachment_source + + + + + hoodie-with-logo-2.jpg + https://woocommercecore.mystagingwebsite.com/?attachment_id=37 + Wed, 16 Jan 2019 13:02:01 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/hoodie-with-logo-2.jpg + + + + 37 + 2019-01-16 13:02:01 + 2019-01-16 13:02:01 + open + closed + hoodie-with-logo-2-jpg + inherit + 7 + 0 + attachment + + 0 + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/hoodie-with-logo-2.jpg + + _wc_attachment_source + + + + + tshirt-2.jpg + https://woocommercecore.mystagingwebsite.com/?attachment_id=38 + Wed, 16 Jan 2019 13:02:02 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/tshirt-2.jpg + + + + 38 + 2019-01-16 13:02:02 + 2019-01-16 13:02:02 + open + closed + tshirt-2-jpg + inherit + 9 + 0 + attachment + + 0 + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/tshirt-2.jpg + + _wc_attachment_source + + + + + beanie-2.jpg + https://woocommercecore.mystagingwebsite.com/?attachment_id=39 + Wed, 16 Jan 2019 13:02:02 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/beanie-2.jpg + + + + 39 + 2019-01-16 13:02:02 + 2019-01-16 13:02:02 + open + closed + beanie-2-jpg + inherit + 10 + 0 + attachment + + 0 + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/beanie-2.jpg + + _wc_attachment_source + + + + + belt-2.jpg + https://woocommercecore.mystagingwebsite.com/?attachment_id=40 + Wed, 16 Jan 2019 13:02:03 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/belt-2.jpg + + + + 40 + 2019-01-16 13:02:03 + 2019-01-16 13:02:03 + open + closed + belt-2-jpg + inherit + 11 + 0 + attachment + + 0 + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/belt-2.jpg + + _wc_attachment_source + + + + + cap-2.jpg + https://woocommercecore.mystagingwebsite.com/?attachment_id=41 + Wed, 16 Jan 2019 13:02:04 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/cap-2.jpg + + + + 41 + 2019-01-16 13:02:04 + 2019-01-16 13:02:04 + open + closed + cap-2-jpg + inherit + 12 + 0 + attachment + + 0 + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/cap-2.jpg + + _wc_attachment_source + + + + + sunglasses-2.jpg + https://woocommercecore.mystagingwebsite.com/?attachment_id=42 + Wed, 16 Jan 2019 13:02:05 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/sunglasses-2.jpg + + + + 42 + 2019-01-16 13:02:05 + 2019-01-16 13:02:05 + open + closed + sunglasses-2-jpg + inherit + 13 + 0 + attachment + + 0 + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/sunglasses-2.jpg + + _wc_attachment_source + + + + + hoodie-with-pocket-2.jpg + https://woocommercecore.mystagingwebsite.com/?attachment_id=43 + Wed, 16 Jan 2019 13:02:06 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/hoodie-with-pocket-2.jpg + + + + 43 + 2019-01-16 13:02:06 + 2019-01-16 13:02:06 + open + closed + hoodie-with-pocket-2-jpg + inherit + 14 + 0 + attachment + + 0 + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/hoodie-with-pocket-2.jpg + + _wc_attachment_source + + + + + hoodie-with-zipper-2.jpg + https://woocommercecore.mystagingwebsite.com/?attachment_id=44 + Wed, 16 Jan 2019 13:02:06 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/hoodie-with-zipper-2.jpg + + + + 44 + 2019-01-16 13:02:06 + 2019-01-16 13:02:06 + open + closed + hoodie-with-zipper-2-jpg + inherit + 15 + 0 + attachment + + 0 + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/hoodie-with-zipper-2.jpg + + _wc_attachment_source + + + + + long-sleeve-tee-2.jpg + https://woocommercecore.mystagingwebsite.com/?attachment_id=45 + Wed, 16 Jan 2019 13:02:07 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/long-sleeve-tee-2.jpg + + + + 45 + 2019-01-16 13:02:07 + 2019-01-16 13:02:07 + open + closed + long-sleeve-tee-2-jpg + inherit + 16 + 0 + attachment + + 0 + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/long-sleeve-tee-2.jpg + + _wc_attachment_source + + + + + polo-2.jpg + https://woocommercecore.mystagingwebsite.com/?attachment_id=46 + Wed, 16 Jan 2019 13:02:08 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/polo-2.jpg + + + + 46 + 2019-01-16 13:02:08 + 2019-01-16 13:02:08 + open + closed + polo-2-jpg + inherit + 17 + 0 + attachment + + 0 + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/polo-2.jpg + + _wc_attachment_source + + + + + album-1.jpg + https://woocommercecore.mystagingwebsite.com/?attachment_id=47 + Wed, 16 Jan 2019 13:02:09 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2022/05/album-1.jpg + + + + 47 + 2019-01-16 13:02:09 + 2019-01-16 13:02:09 + open + closed + album-1-jpg + inherit + 18 + 0 + attachment + + 0 + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2022/05/album-1.jpg + + _wc_attachment_source + + + + + single-1.jpg + https://woocommercecore.mystagingwebsite.com/?attachment_id=48 + Wed, 16 Jan 2019 13:02:10 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/single-1.jpg + + + + 48 + 2019-01-16 13:02:10 + 2019-01-16 13:02:10 + open + closed + single-1-jpg + inherit + 19 + 0 + attachment + + 0 + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/single-1.jpg + + _wc_attachment_source + + + + + t-shirt-with-logo-1.jpg + https://woocommercecore.mystagingwebsite.com/?attachment_id=49 + Wed, 16 Jan 2019 13:02:11 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/t-shirt-with-logo-1.jpg + + + + 49 + 2019-01-16 13:02:11 + 2019-01-16 13:02:11 + open + closed + t-shirt-with-logo-1-jpg + inherit + 26 + 0 + attachment + + 0 + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/t-shirt-with-logo-1.jpg + + _wc_attachment_source + + + + + beanie-with-logo-1.jpg + https://woocommercecore.mystagingwebsite.com/?attachment_id=50 + Wed, 16 Jan 2019 13:02:12 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/beanie-with-logo-1.jpg + + + + 50 + 2019-01-16 13:02:12 + 2019-01-16 13:02:12 + open + closed + beanie-with-logo-1-jpg + inherit + 27 + 0 + attachment + + 0 + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/beanie-with-logo-1.jpg + + _wc_attachment_source + + + + + logo-1.jpg + https://woocommercecore.mystagingwebsite.com/?attachment_id=51 + Wed, 16 Jan 2019 13:02:13 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/logo-1.jpg + + + + 51 + 2019-01-16 13:02:13 + 2019-01-16 13:02:13 + open + closed + logo-1-jpg + inherit + 28 + 0 + attachment + + 0 + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/logo-1.jpg + + _wc_attachment_source + + + + + pennant-1.jpg + https://woocommercecore.mystagingwebsite.com/?attachment_id=52 + Wed, 16 Jan 2019 13:02:13 +0000 + shopmanager + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/pennant-1.jpg + + + + 52 + 2019-01-16 13:02:13 + 2019-01-16 13:02:13 + open + closed + pennant-1-jpg + inherit + 29 + 0 + attachment + + 0 + https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/pennant-1.jpg + + _wc_attachment_source + + + + + diff --git a/blueprints/woo-shipping/woo-shipping-method/woo-shipping-method.php b/blueprints/woo-shipping/woo-shipping-method/woo-shipping-method.php new file mode 100644 index 0000000..723de2c --- /dev/null +++ b/blueprints/woo-shipping/woo-shipping-method/woo-shipping-method.php @@ -0,0 +1,68 @@ +get_shipping_methods(); + $method_exists = false; + + foreach ($shipping_methods as $method) { + if ('flat_rate' == $method->id) { + $method_exists = true; + break; + } + } + + if ($method_exists) { + return; + } + + $instance_id = $zone->add_shipping_method('flat_rate'); + + if (!$instance_id) { + return; + } + + $settings = array( + 'title' => __('My Custom Flat Rate', 'woo-shippinqg-method'), + 'cost' => 10, + 'tax_status' => 'none', + ); + + update_option('woocommerce_flat_rate_' . $instance_id . '_settings', $settings); +} + +add_action('init', 'add_flat_rate_shipping_method'); + +/** + * Enable Direct Bank Transfer Payment Gateway. + */ +function enable_bacs_payment_gateway() { + + if (!class_exists('WC_Payment_Gateway')) { + return; + } + + $bacs_settings = get_option('woocommerce_bacs_settings', array()); + + if (!isset($bacs_settings['enabled']) || 'yes' !== $bacs_settings['enabled']) { + $bacs_settings['enabled'] = 'yes'; + update_option('woocommerce_bacs_settings', $bacs_settings); + } +} + +add_action('woocommerce_init', 'enable_bacs_payment_gateway');