@@ -756,65 +756,40 @@ function() {
756756 \WC ()->cart ->add_fee ( 'Surcharge ' , $ surcharge , true , '' );
757757 }
758758 );
759-
760- // Create legacy flat rate shipping method.
761- update_option (
762- 'woocommerce_flat_rate_settings ' ,
763- array (
764- 'enabled ' => 'yes ' ,
765- 'title ' => 'Flat rate ' ,
766- 'availability ' => 'all ' ,
767- 'countries ' => '' ,
768- 'tax_status ' => 'taxable ' ,
769- 'cost ' => '10 ' ,
770- )
771- );
772- update_option ( 'woocommerce_flat_rate ' , array () );
773-
774- // Create legacy free shipping method.
775- update_option (
776- 'woocommerce_free_shipping_settings ' ,
777- array (
778- 'enabled ' => 'yes ' ,
779- 'title ' => 'Free shipping ' ,
780- 'availability ' => 'all ' ,
781- 'countries ' => '' ,
782- )
783- );
784- update_option ( 'woocommerce_free_shipping ' , array () );
785-
786- // Set shipping debug mode
787- update_option ( 'woocommerce_shipping_debug_mode ' , 'yes ' );
788-
789- // Load shipping methods.
790- \WC_Cache_Helper::get_transient_version ( 'shipping ' , true );
791- \WC ()->shipping ()->load_shipping_methods ();
792759
793760 // Create Shipping Zones.
794761 $ zone = new \WC_Shipping_Zone ();
795762 $ zone ->set_zone_name ( 'Local ' );
796763 $ zone ->set_zone_order ( 1 );
797764 $ zone ->add_location ( 'GB ' , 'country ' );
798765 $ zone ->add_location ( 'CB* ' , 'postcode ' );
799- $ zone ->save ();
766+ $ zone ->save ();
767+ $ zone ->add_shipping_method ( 'flat_rate ' );
768+ $ zone ->add_shipping_method ( 'free_shipping ' );
800769
801770 $ zone = new \WC_Shipping_Zone ();
802771 $ zone ->set_zone_name ( 'Europe ' );
803772 $ zone ->set_zone_order ( 2 );
804773 $ zone ->add_location ( 'EU ' , 'continent ' );
805- $ zone ->save ();
774+ $ zone ->save ();
775+ $ zone ->add_shipping_method ( 'flat_rate ' );
776+ $ zone ->add_shipping_method ( 'free_shipping ' );
806777
807778 $ zone = new \WC_Shipping_Zone ();
808779 $ zone ->set_zone_name ( 'California ' );
809780 $ zone ->set_zone_order ( 3 );
810781 $ zone ->add_location ( 'US:CA ' , 'state ' );
811- $ zone ->save ();
782+ $ zone ->save ();
783+ $ zone ->add_shipping_method ( 'flat_rate ' );
784+ $ zone ->add_shipping_method ( 'free_shipping ' );
812785
813786 $ zone = new \WC_Shipping_Zone ();
814787 $ zone ->set_zone_name ( 'US ' );
815788 $ zone ->set_zone_order ( 4 );
816789 $ zone ->add_location ( 'US ' , 'country ' );
817- $ zone ->save ();
790+ $ zone ->save ();
791+ $ zone ->add_shipping_method ( 'flat_rate ' );
792+ $ zone ->add_shipping_method ( 'free_shipping ' );
818793 }
819794
820795 /**
0 commit comments