Merged in release/release-1.09 (pull request #10)
Release/release 1.09 * Install missing plugins * rs set to 1 * rebase pantheon for aws * rebase pantheon for aws * prod config change * prod config change * fix campaing issue * revert Approved-by: Jay Sharma
This commit is contained in:
committed by
Jay Sharma
parent
779393381f
commit
22f10a9edd
@@ -133,19 +133,7 @@ class Homescreen {
|
||||
$zone = new \WC_Shipping_Zone();
|
||||
$zone->set_zone_name( $country_name );
|
||||
$zone->add_location( $country_code, 'country' );
|
||||
|
||||
// Method creation has no default title, use the REST API to add a title.
|
||||
$instance_id = $zone->add_shipping_method( 'free_shipping' );
|
||||
$request = new \WP_REST_Request( 'POST', '/wc/v2/shipping/zones/' . $zone->get_id() . '/methods/' . $instance_id );
|
||||
$request->set_body_params(
|
||||
array(
|
||||
'settings' => array(
|
||||
'title' => 'Free shipping',
|
||||
),
|
||||
)
|
||||
);
|
||||
rest_do_request( $request );
|
||||
|
||||
$zone->add_shipping_method( 'free_shipping' );
|
||||
update_option( 'woocommerce_admin_created_default_shipping_zones', 'yes' );
|
||||
Shipping::delete_zone_count_transient();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user