Update routines

This commit is contained in:
Mike Jolley 2019-02-12 13:27:30 +00:00
parent 64df8a2934
commit ac51d1f1df
2 changed files with 19 additions and 1 deletions

View File

@ -124,6 +124,10 @@ class WC_Install {
'wc_update_354_modify_shop_manager_caps', 'wc_update_354_modify_shop_manager_caps',
'wc_update_354_db_version', 'wc_update_354_db_version',
), ),
'3.6.0' => array(
'wc_update_360_product_lookup_tables',
'wc_update_360_db_version',
),
); );
/** /**

View File

@ -740,7 +740,7 @@ function wc_update_240_shipping_methods() {
if ( version_compare( $shipping_method->get_option( 'version', 0 ), '2.4.0', '<' ) ) { if ( version_compare( $shipping_method->get_option( 'version', 0 ), '2.4.0', '<' ) ) {
$shipping_classes = WC()->shipping()->get_shipping_classes(); $shipping_classes = WC()->shipping()->get_shipping_classes();
$has_classes = count( $shipping_classes ) > 0; $has_classes = count( $shipping_classes ) > 0;
$cost_key = $has_classes ? 'no_class_cost': 'cost'; $cost_key = $has_classes ? 'no_class_cost' : 'cost';
$min_fee = $shipping_method->get_option( 'minimum_fee' ); $min_fee = $shipping_method->get_option( 'minimum_fee' );
$math_cost_strings = array( $math_cost_strings = array(
'cost' => array(), 'cost' => array(),
@ -1932,3 +1932,17 @@ function wc_update_354_modify_shop_manager_caps() {
function wc_update_354_db_version() { function wc_update_354_db_version() {
WC_Install::update_db_version( '3.5.4' ); WC_Install::update_db_version( '3.5.4' );
} }
/**
* Update product lookup tables in bulk.
*/
function wc_update_360_product_lookup_tables() {
wc_update_product_lookup_tables();
}
/**
* Update DB Version.
*/
function wc_update_360_db_version() {
WC_Install::update_db_version( '3.6.0' );
}