Changeset 2444165
- Timestamp:
- 12/22/2020 07:53:04 AM (5 years ago)
- Location:
- woo-gst
- Files:
-
- 1 added
- 5 edited
-
tags/1.3 (added)
-
trunk/class-gst-woocommerce-addon.php (modified) (12 diffs)
-
trunk/inc/functions.php (modified) (1 diff)
-
trunk/readme.txt (modified) (4 diffs)
-
trunk/screenshot-2.png (modified) (previous)
-
trunk/woocommerce-gst-addon.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
woo-gst/trunk/class-gst-woocommerce-addon.php
r1962125 r2444165 14 14 public function init() { 15 15 16 add_filter( 'woocommerce_settings_tabs_array', array( $this ,'fn_add_settings_tab' ), 50 ); 17 add_action( 'woocommerce_settings_tabs_settings_gst_tab', array( $this , 'fn_settings_tab') ); 18 add_action( 'woocommerce_update_options_settings_gst_tab', array( $this , 'fn_update_settings') ); 19 add_action( 'woocommerce_update_options_tax', array( $this , 'fn_update_tax_settings') ); 20 add_action( 'init', array( $this , 'fn_gst_callback') ); 21 add_action('woocommerce_product_options_general_product_data', array( $this , 'fn_add_product_custom_meta_box') ); 22 add_action( 'woocommerce_process_product_meta', array( $this , 'fn_save_license_field') ); 16 add_filter( 'woocommerce_settings_tabs_array', array( $this ,'fn_add_settings_tab' ), 50 ); 17 add_action( 'woocommerce_settings_tabs_settings_gst_tab', array( $this , 'fn_settings_tab') ); 18 add_action( 'woocommerce_update_options_settings_gst_tab', array( $this , 'fn_update_settings') ); 19 add_action( 'woocommerce_update_options_tax', array( $this , 'fn_update_tax_settings') ); 20 // add_action( 'init', array( $this , 'fn_gst_callback') ); 21 add_action( 'woocommerce_update_options_settings_gst_tab', array( $this , 'fn_update_tax_settings') ); 22 add_action('woocommerce_product_options_general_product_data', array( $this , 'fn_add_product_custom_meta_box') ); 23 add_action( 'woocommerce_process_product_meta', array( $this , 'fn_save_license_field') ); 23 24 add_action( 'admin_print_scripts', array( $this , 'fn_load_custom_wp_admin_script'), 999 ); 24 add_action( 'woocommerce_email_after_order_table', array( $this , 'fn_woocommerce_gstin_invoice_fields') );25 add_action( 'woocommerce_email_after_order_table', array( $this , 'fn_woocommerce_gstin_invoice_fields') ); 25 26 add_action( 'admin_notices', array( $this , 'print_pro_notice') ); 26 27 add_filter( 'plugin_row_meta', array( $this, 'fn_add_extra_links' ), 10, 2 ); … … 38 39 } 39 40 function fn_woocommerce_gstin_invoice_fields( $order ) { 40 ?>41 <p><strong><?php _e('GSTIN Number:', 'woocommerce'); ?></strong> <?php echo get_option('woocommerce_gstin_number'); ?></p>42 <?php41 ?> 42 <p><strong><?php _e('GSTIN Number:', 'woocommerce'); ?></strong> <?php echo get_option('woocommerce_gstin_number'); ?></p> 43 <?php 43 44 } 44 45 … … 47 48 ?> 48 49 <script> 49 jQuery(document).ready(function($) {50 51 if($('#woocommerce_product_types').val() == 'multiple'){52 hide_singe();53 } else {54 hide_mutiple();55 }56 $('#woocommerce_product_types').change(function(){57 if($(this).val() == 'single'){58 hide_mutiple();59 } else {60 hide_singe();61 }62 });63 64 function hide_singe(){65 $('select[name="woocommerce_gst_single_select_slab"]').parents('tr:first').hide();66 $('select[name="woocommerce_gst_multi_select_slab[]"]').parents('tr:first').show();67 }68 69 function hide_mutiple(){70 $('select[name="woocommerce_gst_multi_select_slab[]"]').parents('tr:first').hide();71 $('select[name="woocommerce_gst_single_select_slab"]').parents('tr:first').show();72 }73 });50 jQuery(document).ready(function($) { 51 52 if($('#woocommerce_product_types').val() == 'multiple'){ 53 hide_singe(); 54 } else { 55 hide_mutiple(); 56 } 57 $('#woocommerce_product_types').change(function(){ 58 if($(this).val() == 'single'){ 59 hide_mutiple(); 60 } else { 61 hide_singe(); 62 } 63 }); 64 65 function hide_singe(){ 66 $('select[name="woocommerce_gst_single_select_slab"]').parents('tr:first').hide(); 67 $('select[name="woocommerce_gst_multi_select_slab[]"]').parents('tr:first').show(); 68 } 69 70 function hide_mutiple(){ 71 $('select[name="woocommerce_gst_multi_select_slab[]"]').parents('tr:first').hide(); 72 $('select[name="woocommerce_gst_single_select_slab"]').parents('tr:first').show(); 73 } 74 }); 74 75 </script> 75 76 <?php 76 }77 78 public function fn_add_product_custom_meta_box() {79 woocommerce_wp_text_input(80 array(81 'id' => 'hsn_prod_id',82 'label' => __('HSN Code', 'woocommerce' ),83 'description' => __( 'HSN Code is mandatory for GST.', 'woocommerce' ),84 'custom_attributes' => array( 'required' => 'required' ),85 'value' => get_post_meta( get_the_ID(), 'hsn_prod_id', true )86 )87 );88 }89 90 public function fn_save_license_field( $post_id ) {91 $value = ( $_POST['hsn_prod_id'] )? sanitize_text_field( $_POST['hsn_prod_id'] ) : '' ;92 update_post_meta( $post_id, 'hsn_prod_id', $value );93 }77 } 78 79 public function fn_add_product_custom_meta_box() { 80 woocommerce_wp_text_input( 81 array( 82 'id' => 'hsn_prod_id', 83 'label' => __('HSN Code', 'woocommerce' ), 84 'description' => __( 'HSN Code is mandatory for GST.', 'woocommerce' ), 85 'custom_attributes' => array( 'required' => 'required' ), 86 'value' => get_post_meta( get_the_ID(), 'hsn_prod_id', true ) 87 ) 88 ); 89 } 90 91 public function fn_save_license_field( $post_id ) { 92 $value = ( $_POST['hsn_prod_id'] )? sanitize_text_field( $_POST['hsn_prod_id'] ) : '' ; 93 update_post_meta( $post_id, 'hsn_prod_id', $value ); 94 } 94 95 95 96 /** … … 100 101 */ 101 102 public static function fn_add_settings_tab( $settings_tabs ) { 102 $settings_tabs['settings_gst_tab'] = __( 'GST Settings', 'woocommerce' );103 return $settings_tabs;103 $settings_tabs['settings_gst_tab'] = __( 'GST Settings', 'woocommerce' ); 104 return $settings_tabs; 104 105 } 105 106 /** … … 119 120 */ 120 121 public static function fn_update_settings() { 121 self::gst_insrt_tax_slab_rows();122 woocommerce_update_options( self::fn_get_settings() );122 self::gst_insrt_tax_slab_rows(); 123 woocommerce_update_options( self::fn_get_settings() ); 123 124 } 124 125 … … 128 129 */ 129 130 public static function fn_update_tax_settings() { 130 self::fn_gst_callback(); 131 if ( isset( $_POST['custom_gst_nonce'] ) && wp_verify_nonce( $_POST['custom_gst_nonce'], 'wc_gst_nonce' )){ 132 self::fn_gst_callback(); 133 } 134 131 135 } 132 136 … … 138 142 */ 139 143 public static function fn_gst_callback() { 140 $a_currunt_tax_slabs = array(); 141 $a_gst_tax_slabs = array(); 142 $s_woocommerce_product_types = get_option( 'woocommerce_product_types' ); 143 144 if( isset( $s_woocommerce_product_types ) && $s_woocommerce_product_types == 'multiple' ){ 145 $s_product_types = get_option( 'woocommerce_gst_multi_select_slab' ); 146 $a_gst_tax_slabs = array_merge( $a_gst_tax_slabs, $s_product_types ); 147 } elseif( isset( $s_woocommerce_product_types ) && $s_woocommerce_product_types == 'single' ) { 148 $s_product_types = get_option( 'woocommerce_gst_single_select_slab' ); 149 array_push( $a_gst_tax_slabs, $s_product_types ); 150 } 151 152 $s_woocommerce_tax_classes = get_option('woocommerce_tax_classes'); 153 if( isset( $s_woocommerce_tax_classes ) ){ 154 $a_currunt_tax_slabs = explode( PHP_EOL, $s_woocommerce_tax_classes ); 155 $i_old_count = count( $a_currunt_tax_slabs ); 156 foreach ( $a_gst_tax_slabs as $gst_tax_value ) { 157 if ( !in_array( $gst_tax_value, $a_currunt_tax_slabs ) ) 158 array_push( $a_currunt_tax_slabs, $gst_tax_value ); 159 } 160 $i_new_count = count( $a_currunt_tax_slabs ); 161 if( $i_new_count == $i_old_count ){ 162 return; 163 } 164 } 165 $a_currunt_tax_slabs = ( !$a_currunt_tax_slabs ) ? $a_gst_tax_slabs : $a_currunt_tax_slabs ; 166 $a_currunt_tax_slabs = implode( PHP_EOL, $a_currunt_tax_slabs ); 167 update_option( 'woocommerce_tax_classes', $a_currunt_tax_slabs ); 144 global $wpdb; 145 $table_prefix = $wpdb->prefix . "wc_tax_rate_classes"; 146 $a_currunt_tax_slabs = array(); 147 $a_gst_tax_slabs = array(); 148 $s_woocommerce_product_types = get_option( 'woocommerce_product_types' ); 149 150 if( isset( $s_woocommerce_product_types ) && $s_woocommerce_product_types == 'multiple' ){ 151 $s_product_types = get_option( 'woocommerce_gst_multi_select_slab' ); 152 $a_gst_tax_slabs = array_merge( $a_gst_tax_slabs, $s_product_types ); 153 154 } elseif( isset( $s_woocommerce_product_types ) && $s_woocommerce_product_types == 'single' ) { 155 $s_product_types = get_option( 'woocommerce_gst_single_select_slab' ); 156 array_push( $a_gst_tax_slabs, $s_product_types ); 157 } 158 159 $s_woocommerce_tax_classes = get_option('woocommerce_tax_classes'); 160 161 if( isset( $s_woocommerce_tax_classes ) ){ 162 // $a_currunt_tax_slabs = explode( PHP_EOL, $s_woocommerce_tax_classes ); 163 $a_currunt_tax_slabs = array(); 164 165 $i_old_count = count( $a_currunt_tax_slabs ); 166 $old_tax_slabs = $a_currunt_tax_slabs; 167 foreach ( $a_gst_tax_slabs as $gst_tax_value ) { 168 if ( !in_array( $gst_tax_value, $a_currunt_tax_slabs ) ) 169 array_push( $a_currunt_tax_slabs, $gst_tax_value ); 170 } 171 172 $i_new_count = count( $a_currunt_tax_slabs ); 173 if( $i_new_count == $i_old_count ){ 174 return; 175 } 176 $diff1 = array_diff($old_tax_slabs,$a_currunt_tax_slabs); 177 $diff2 = array_diff($a_currunt_tax_slabs,$old_tax_slabs); 178 179 if(!empty($diff1) || !empty($diff2)) { 180 $tax_slab_array = $a_currunt_tax_slabs; 181 if(woogst_get_woo_version_number() >= '3.7.0') { 182 foreach ($tax_slab_array as $tax_value) { 183 $slug = str_replace('%', '', $tax_value); 184 $tax_rate_class_id = $wpdb->get_var("SELECT tax_rate_class_id FROM $table_prefix WHERE name='$tax_value'"); 185 if(($tax_rate_class_id == NULL || empty($tax_rate_class_id)) && !empty($tax_value)) { 186 $wpdb->insert($table_prefix,array( 'name' => $tax_value, 'slug' => $slug),array( '%s','%s' )); 187 } 188 } 189 190 } 191 } else { 192 return; 193 } 194 } 195 $a_currunt_tax_slabs = ( !$a_currunt_tax_slabs ) ? $a_gst_tax_slabs : $a_currunt_tax_slabs ; 196 $a_currunt_tax_slabs = implode( PHP_EOL, $a_currunt_tax_slabs ); 197 update_option( 'woocommerce_tax_classes', $a_currunt_tax_slabs ); 168 198 } 169 199 … … 173 203 */ 174 204 public static function gst_insrt_tax_slab_rows() { 175 global $wpdb; 176 177 178 $a_multiple_slabs = array();179 if( isset( $_POST['woocommerce_product_types'] ) && $_POST['woocommerce_product_types'] == 'multiple' ){205 206 global $wpdb; 207 208 $a_multiple_slabs = array(); 209 if( isset( $_POST['woocommerce_product_types'] ) && $_POST['woocommerce_product_types'] == 'multiple' ){ 180 210 $multi_select_slab = $_POST['woocommerce_gst_multi_select_slab']; 181 211 if( ! empty( $multi_select_slab ) ) 182 212 $a_multiple_slabs = array_merge( $a_multiple_slabs, $multi_select_slab ); 183 } elseif ( isset( $_POST['woocommerce_product_types'] ) ){213 } elseif ( isset( $_POST['woocommerce_product_types'] ) ){ 184 214 $single_select_slab = $_POST['woocommerce_gst_single_select_slab']; 185 array_push( $a_multiple_slabs, $single_select_slab ); 186 }187 188 $table_prefix = $wpdb->prefix . "woocommerce_tax_rates";215 array_push( $a_multiple_slabs, $single_select_slab ); 216 } 217 218 $table_prefix = $wpdb->prefix . "woocommerce_tax_rates"; 189 219 190 220 $s_woocommerce_tax_classes = get_option('woocommerce_tax_classes'); … … 194 224 if( !empty( $s_woocommerce_tax_classes ) ) 195 225 $a_currunt_tax_slabs = explode( PHP_EOL, $s_woocommerce_tax_classes ); 196 197 198 199 foreach ( $a_multiple_slabs as $a_multiple_slab ) { 200 if( $a_multiple_slab != '0%' && ! in_array( $a_multiple_slab, $a_currunt_tax_slabs ) ){ 201 $slab_name = preg_replace('/%/', '', $a_multiple_slab); 202 $state_tax =''; 203 switch ($slab_name) { 204 case '5': 205 $state_tax = '2.5'; 206 break; 207 case '12': 208 $state_tax = '6'; 209 break; 210 case '18': 211 $state_tax = '9'; 212 break; 213 case '28': 214 $state_tax = '14'; 215 break; 216 217 default: 218 $state_tax =''; 219 break; 220 } 226 // $a_currunt_tax_slabs = array(); 227 228 229 230 foreach ( $a_multiple_slabs as $a_multiple_slab ) { 231 232 // if( $a_multiple_slab != '0%' && ! in_array( $a_multiple_slab, $a_currunt_tax_slabs ) ){ 233 $slab_name = preg_replace('/%/', '', $a_multiple_slab); 234 $state_tax =''; 235 236 $state_tax = $slab_name / 2; 221 237 222 238 $state = get_option( 'woocommerce_store_state' ); 239 $ut_state = array('CH','AN','DN','DD', 'LD'); 223 240 if( isset( $state ) ) : 224 $wpdb->insert($table_prefix,array( 'tax_rate_country' => 'IN', 'tax_rate_state' => $state,'tax_rate' => $state_tax,'tax_rate_name' => $state_tax."% CGST",'tax_rate_priority' => 1,'tax_rate_compound' => 0,'tax_rate_shipping' => 0,'tax_rate_order' => 0,'tax_rate_class' =>$slab_name),array( '%s','%s','%s','%s','%d','%d','%d','%d','%s')); 225 226 $wpdb->insert($table_prefix,array( 'tax_rate_country' => 'IN', 'tax_rate_state' => $state,'tax_rate' => $state_tax,'tax_rate_name' => $state_tax."% SGST",'tax_rate_priority' => 2,'tax_rate_compound' => 0,'tax_rate_shipping' => 0,'tax_rate_order' => 0,'tax_rate_class' =>$slab_name),array( '%s','%s','%s','%s','%d','%d','%d','%d','%s')); 227 228 $wpdb->insert($table_prefix,array( 'tax_rate_country' => 'IN', 'tax_rate_state' => '','tax_rate' => $slab_name,'tax_rate_name' => $slab_name."% IGST",'tax_rate_priority' => 1,'tax_rate_compound' => 0,'tax_rate_shipping' => 0,'tax_rate_order' => 0,'tax_rate_class' =>$slab_name),array( '%s','%s','%s','%s','%d','%d','%d','%d','%s')); 241 242 $tax_slab_row_cgst = $state_tax."% CGST"; 243 $tax_slab_row_utgst = $state_tax."% UTGST"; 244 $tax_slab_row_sgst = $state_tax."% SGST"; 245 $tax_slab_row_igst = $slab_name."% IGST"; 246 247 $table_tax_prefix = $wpdb->prefix . "woocommerce_tax_rates"; 248 249 $select_table_tax_cgst = $wpdb->get_var("SELECT tax_rate_id FROM $table_tax_prefix WHERE tax_rate_name='$tax_slab_row_cgst'"); 250 251 $select_table_tax_utgst = $wpdb->get_var("SELECT tax_rate_id FROM $table_tax_prefix WHERE tax_rate_name='$tax_slab_row_utgst'"); 252 253 $select_table_tax_sgst = $wpdb->get_var("SELECT tax_rate_id FROM $table_tax_prefix WHERE tax_rate_name='$tax_slab_row_sgst'"); 254 255 $select_table_tax_igst = $wpdb->get_var("SELECT tax_rate_id FROM $table_tax_prefix WHERE tax_rate_name='$tax_slab_row_igst'"); 256 257 258 259 if( ($select_table_tax_cgst == NULL || empty($select_table_tax_cgst)) ){ 260 $wpdb->insert($table_prefix,array( 'tax_rate_country' => 'IN', 'tax_rate_state' => $state,'tax_rate' => $state_tax,'tax_rate_name' => $state_tax."% CGST",'tax_rate_priority' => 1,'tax_rate_compound' => 0,'tax_rate_shipping' => 0,'tax_rate_order' => 0,'tax_rate_class' =>$slab_name),array( '%s','%s','%s','%s','%d','%d','%d','%d','%s')); 261 } 262 263 if(in_array($state, $ut_state)){ 264 265 if( ($select_table_tax_utgst == NULL || empty($select_table_tax_utgst)) ){ 266 $wpdb->insert($table_prefix,array( 'tax_rate_country' => 'IN', 'tax_rate_state' => $state,'tax_rate' => $state_tax,'tax_rate_name' => $state_tax."% UTGST",'tax_rate_priority' => 2,'tax_rate_compound' => 0,'tax_rate_shipping' => 0,'tax_rate_order' => 0,'tax_rate_class' =>$slab_name),array( '%s','%s','%s','%s','%d','%d','%d','%d','%s')); 267 } 268 } else { 269 if( ($select_table_tax_sgst == NULL || empty($select_table_tax_sgst)) ){ 270 $wpdb->insert($table_prefix,array( 'tax_rate_country' => 'IN', 'tax_rate_state' => $state,'tax_rate' => $state_tax,'tax_rate_name' => $state_tax."% SGST",'tax_rate_priority' => 2,'tax_rate_compound' => 0,'tax_rate_shipping' => 0,'tax_rate_order' => 0,'tax_rate_class' =>$slab_name),array( '%s','%s','%s','%s','%d','%d','%d','%d','%s')); 271 } 272 273 } 274 275 if( ($select_table_tax_igst == NULL || empty($select_table_tax_igst)) ){ 276 $wpdb->insert($table_prefix,array( 'tax_rate_country' => 'IN', 'tax_rate_state' => '','tax_rate' => $slab_name,'tax_rate_name' => $slab_name."% IGST",'tax_rate_priority' => 1,'tax_rate_compound' => 0,'tax_rate_shipping' => 0,'tax_rate_order' => 0,'tax_rate_class' =>$slab_name),array( '%s','%s','%s','%s','%d','%d','%d','%d','%s')); 277 } 229 278 endif; 230 }231 }279 // } 280 } 232 281 233 282 } … … 240 289 public static function fn_get_settings() { 241 290 242 $location = wc_get_base_location(); 243 $state = esc_attr( $location['state'] ); 244 245 $settings = array( 246 'section_title' => array( 247 'name' => __( 'Select Product Type', 'woocommerce' ), 248 'type' => 'title', 249 'desc' => '', 250 'id' => 'wc_settings_gst_tab_section_title' 251 ), 252 'GSTIN_number' => array( 253 254 'name' => __( 'GSTIN Number', 'woocommerce' ), 255 256 'desc' => __( 'This GSTIN number display on your invoice.', 'woocommerce' ), 257 258 'id' => 'woocommerce_gstin_number', 259 260 'css' => 'min-width:150px;', 261 262 'std' => 'left', // WooCommerce < 2.0 263 264 'default' => '', // WooCommerce >= 2.0 291 $state = get_option( 'woocommerce_store_state' ); 292 $settings = array( 293 'section_title' => array( 294 'name' => __( 'Select Product Type', 'woocommerce' ), 295 'type' => 'title', 296 'desc' => '', 297 'id' => 'wc_settings_gst_tab_section_title' 298 ), 299 'GSTIN_number' => array( 300 301 'name' => __( 'GSTIN Number', 'woocommerce' ), 302 303 'desc' => __( 'This GSTIN number display on your invoice.', 'woocommerce' ), 304 305 'id' => 'woocommerce_gstin_number', 306 307 'css' => 'min-width:150px;', 308 309 'std' => 'left', // WooCommerce < 2.0 310 311 'default' => '', // WooCommerce >= 2.0 265 312 266 313 'custom_attributes' => array( 'required' => 'required' ), 267 314 268 'type' => 'text',269 270 ),315 'type' => 'text', 316 317 ), 271 318 'store_state' => array( 272 319 … … 284 331 285 332 'custom_attributes' => array( 'required' => 'required' ), 333 334 'custom_attributes' => array('readonly' => 'readonly'), 286 335 287 336 'type' => 'text', … … 290 339 'prod_types' => array( 291 340 292 'name' => __( 'Select Product Types', 'woocommerce' ),293 294 'desc' => __( 'Select single or multiple tax slab.', 'woocommerce' ),295 296 'id' => 'woocommerce_product_types',297 298 'css' => 'min-width:150px;height:auto;',299 300 'std' => 'left', // WooCommerce < 2.0301 302 'default' => 'left', // WooCommerce >= 2.0303 304 'type' => 'select',305 306 'options' => array(307 308 'single' => __( 'Single', 'woocommerce' ),309 310 'multiple' => __( 'Multiple', 'woocommerce' ),311 312 ),313 314 'desc_tip' => true,315 316 ),341 'name' => __( 'Select Product Types', 'woocommerce' ), 342 343 'desc' => __( 'Select single or multiple tax slab.', 'woocommerce' ), 344 345 'id' => 'woocommerce_product_types', 346 347 'css' => 'min-width:150px;height:auto;', 348 349 'std' => 'left', // WooCommerce < 2.0 350 351 'default' => 'left', // WooCommerce >= 2.0 352 353 'type' => 'select', 354 355 'options' => array( 356 357 'single' => __( 'Single', 'woocommerce' ), 358 359 'multiple' => __( 'Multiple', 'woocommerce' ), 360 361 ), 362 363 'desc_tip' => true, 364 365 ), 317 366 'woocommerce_gst_multi_select_slab' => array( 318 367 319 'name' => __( 'Select Multiple Tax Slabs ', 'woocommerce' ),320 321 'desc' => __( 'Multiple tax slabs.', 'woocommerce' ),322 323 'id' => 'woocommerce_gst_multi_select_slab',324 325 'css' => 'min-width:150px;',326 327 'std' => 'left', // WooCommerce < 2.0328 329 'default' => 'left', // WooCommerce >= 2.0330 331 'type' => 'multi_select_countries',332 333 'options' => array(334 335 '0%' => __( '0%', 'woocommerce' ),336 337 '5%' => __( '5%', 'woocommerce' ),338 339 '12%' => __( '12%', 'woocommerce' ),340 341 '18%' => __( '18%', 'woocommerce' ),342 343 '28%' => __( '28%', 'woocommerce' ),344 345 ),346 347 'desc_tip' => true,348 349 ),368 'name' => __( 'Select Multiple Tax Slabs ', 'woocommerce' ), 369 370 'desc' => __( 'Multiple tax slabs.', 'woocommerce' ), 371 372 'id' => 'woocommerce_gst_multi_select_slab', 373 374 'css' => 'min-width:150px;', 375 376 'std' => 'left', // WooCommerce < 2.0 377 378 'default' => 'left', // WooCommerce >= 2.0 379 380 'type' => 'multi_select_countries', 381 382 'options' => array( 383 384 '0%' => __( '0%', 'woocommerce' ), 385 386 '5%' => __( '5%', 'woocommerce' ), 387 388 '12%' => __( '12%', 'woocommerce' ), 389 390 '18%' => __( '18%', 'woocommerce' ), 391 392 '28%' => __( '28%', 'woocommerce' ), 393 394 ), 395 396 'desc_tip' => true, 397 398 ), 350 399 351 400 'woocommerce_gst_single_select_slab' => array( 352 401 353 'name' => __( 'Select Tax Slab', 'woocommerce' ), 354 355 'desc' => __( 'Tax slab.', 'woocommerce' ), 356 357 'id' => 'woocommerce_gst_single_select_slab', 358 359 'css' => 'min-width:150px;height:auto;', 360 361 'std' => 'left', // WooCommerce < 2.0 362 363 'default' => 'left', // WooCommerce >= 2.0 364 365 'type' => 'select', 366 367 'options' => array( 368 369 '0%' => __( '0%', 'woocommerce' ), 370 371 '5%' => __( '5%', 'woocommerce' ), 372 373 '12%' => __( '12%', 'woocommerce' ), 374 375 '18%' => __( '18%', 'woocommerce' ), 376 377 '28%' => __( '28%', 'woocommerce' ), 378 379 ), 380 381 'desc_tip' => true, 382 383 ), 402 'name' => __( 'Select Tax Slab', 'woocommerce' ), 403 404 'desc' => __( 'Tax slab.', 'woocommerce' ), 405 406 'id' => 'woocommerce_gst_single_select_slab', 407 408 'css' => 'min-width:150px;height:auto;', 409 410 'std' => 'left', // WooCommerce < 2.0 411 412 'default' => 'left', // WooCommerce >= 2.0 413 414 'type' => 'select', 415 416 'options' => array( 417 418 '0%' => __( '0%', 'woocommerce' ), 419 420 '5%' => __( '5%', 'woocommerce' ), 421 422 '12%' => __( '12%', 'woocommerce' ), 423 424 '18%' => __( '18%', 'woocommerce' ), 425 426 '28%' => __( '28%', 'woocommerce' ), 427 428 ), 429 430 'desc_tip' => true, 431 432 ), 433 434 'gst_nonce' => array( 435 436 'name' => __( 'GST nonce', 'woocommerce' ), 437 438 'desc' => __( 'GST nonce.', 'woocommerce' ), 439 440 'id' => 'woocommerce_gst_nonce', 441 442 'css' => 'min-width:150px;', 443 444 'std' => 'left', // WooCommerce < 2.0 445 446 'default' => wp_nonce_field( 'wc_gst_nonce', 'custom_gst_nonce' ), // WooCommerce >= 2.0 447 448 'type' => 'hidden', 449 450 ), 384 451 385 452 386 453 387 454 'section_end' => array( 388 'type' => 'sectionend',389 'id' => 'wc_settings_gst_tab_section_end'455 'type' => 'sectionend', 456 'id' => 'wc_settings_gst_tab_section_end' 390 457 ) 391 458 ); 392 return apply_filters( 'wc_settings_gst_tab_settings', $settings );459 return apply_filters( 'wc_settings_gst_tab_settings', $settings ); 393 460 } 394 461 -
woo-gst/trunk/inc/functions.php
r1786309 r2444165 26 26 } 27 27 } 28 29 if ( ! function_exists( 'woogst_get_woo_version_number' ) ) { 30 function woogst_get_woo_version_number() { 31 // If get_plugins() isn't available, require it 32 if ( ! function_exists( 'get_plugins' ) ) 33 require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); 34 35 // Create the plugins folder and file variables 36 $plugin_folder = get_plugins( '/' . 'woocommerce' ); 37 $plugin_file = 'woocommerce.php'; 38 39 // If the plugin version number is set, return it 40 if ( isset( $plugin_folder[$plugin_file]['Version'] ) ) { 41 return $plugin_folder[$plugin_file]['Version']; 42 43 } else { 44 // Otherwise return null 45 return NULL; 46 } 47 } 48 } 49 28 50 ?> -
woo-gst/trunk/readme.txt
r2091510 r2444165 3 3 Tags: gst, woocommerce, addon, woocommerce addon, gst tax, woocommerce tax, indian gst tax,hsn, hsn code, hsn code woocommerce, pdf, invoice, pdf invoice, gst invoice, gst pdf invoice 4 4 Requires at least: 4.0 5 Requires PHP : 5. 56 Tested up to: 5. 27 Stable tag: 1. 25 Requires PHP : 5.6 6 Tested up to: 5.6 7 Stable tag: 1.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 22 22 * Admin can choose required tax slabs. 23 23 * Generates tax slabs with CGST, SGST and IGST automatically. 24 * Added UTGST(Union Territory Goods and Service Tax.) support. 24 25 * Dynamic tax slabs (**PRO**). 25 26 * PDF invoice with GSTIN and HSN Number (**PRO**). … … 50 51 51 52 == Changelog == 53 = 1.3 = 54 * Fixed Auto create Tax Slabs issue. 55 * Added UTGST support for five Union Territories of India. 56 52 57 = 1.2 = 53 58 * Fixed minor bugs. … … 59 64 60 65 == Upgrade Notice == 66 = 1.3 = 67 * Fixed Auto create Tax Slabs issue. 68 * Added UTGST support for five Union Territories of India. 61 69 62 70 = 1.2 = -
woo-gst/trunk/woocommerce-gst-addon.php
r2091510 r2444165 5 5 * Author: Stark Digital 6 6 * Author URI: https://www.starkdigital.net 7 * Version: 1. 27 * Version: 1.3 8 8 * Plugin URI: https://www.woocommercegst.co.in 9 9 * WC requires at least: 3.0.0 10 * WC tested up to: 3.6.310 * WC tested up to: 4.8.0 11 11 */ 12 12
Note: See TracChangeset
for help on using the changeset viewer.