wc_update_250_currency

The WooCommerce wc update 250 currency function.

Description

wc_update_250_currency(); 

Usage

  1. if ( !function_exists( 'wc_update_250_currency' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-update-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wc_update_250_currency(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/includes/wc-update-functions.php  
  1. function wc_update_250_currency() { 
  2. global $wpdb; 
  3. // Fix currency settings for LAK currency. 
  4. $current_currency = get_option( 'woocommerce_currency' ); 
  5.  
  6. if ( 'KIP' === $current_currency ) { 
  7. update_option( 'woocommerce_currency', 'LAK' ); 
  8.  
  9. // Update LAK currency code. 
  10. $wpdb->update( 
  11. $wpdb->postmeta,  
  12. array( 
  13. 'meta_value' => 'LAK',  
  14. ),  
  15. array( 
  16. 'meta_key' => '_order_currency',  
  17. 'meta_value' => 'KIP',  
  18. );