billogram_update

Functon for plugin update.

Description

billogram_update(); 

Usage

  1. if ( !function_exists( 'billogram_update' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-billogram-integration/woocommerce-billogram2-extended.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = billogram_update(); 
  7.  

Defined (1)

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

/woocommerce-billogram2-extended.php  
  1. function billogram_update() { 
  2. global $wpdb; 
  3. $table_name = "wcb_orders"; 
  4. $billogram_version = get_option('billogram_version'); 
  5. if($billogram_version != '' && floatval($billogram_version) < 1.3 ) { 
  6. $wpdb->query ("ALTER TABLE ".$table_name."  
  7. ADD invoice_no MEDIUMINT( 20 ) NOT NULL AFTER order_id,  
  8. ADD ocr_number BIGINT( 9 ) NOT NULL AFTER invoice_no"); 
  9. if(floatval($billogram_version) < 1.9 ) { 
  10. $wpdb->query ("ALTER TABLE ".$table_name."  
  11. ADD invoice_id VARCHAR( 20 ) NOT NULL AFTER order_id"); 
  12. update_option('billogram_version', '2.46');