Skip to content

Commit

Permalink
v2.12.5
Browse files Browse the repository at this point in the history
  • Loading branch information
kousikmukherjee committed Jul 18, 2024
1 parent a6319bf commit 6c2e236
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 76 deletions.
8 changes: 4 additions & 4 deletions eu-vat-for-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
Plugin Name: EU/UK VAT for WooCommerce
Plugin URI: https://wpfactory.com/item/eu-vat-for-woocommerce/
Description: Manage EU VAT in WooCommerce. Beautifully.
Version: 2.12.4
Version: 2.12.5
Author: WPFactory
Author URI: https://wpfactory.com/
Text Domain: eu-vat-for-woocommerce
Domain Path: /langs
Copyright: © 2023 WPFactory
WC tested up to: 8.9
WC tested up to: 9.0
License: GNU General Public License v3.0
License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
Expand All @@ -22,7 +22,7 @@
* Main Alg_WC_EU_VAT Class
*
* @class Alg_WC_EU_VAT
* @version 2.12.4
* @version 2.12.5
* @since 1.0.0
*/
final class Alg_WC_EU_VAT {
Expand All @@ -33,7 +33,7 @@ final class Alg_WC_EU_VAT {
* @var string
* @since 1.0.0
*/
public $version = '2.12.4';
public $version = '2.12.5';
public $core = null;
public $settings = array();

Expand Down
14 changes: 9 additions & 5 deletions includes/class-alg-wc-eu-vat-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* EU VAT for WooCommerce - Core Class
*
* @version 2.12.4
* @version 2.12.5
* @since 1.0.0
* @author WPFactory
*/
Expand All @@ -28,7 +28,7 @@ class Alg_WC_EU_VAT_Core {
/**
* Constructor.
*
* @version 2.12.4
* @version 2.12.5
* @since 1.0.0
* @todo [dev] (maybe) "eu vat number" to "eu vat"
* @todo [feature] `add_eu_vat_verify_button` (`woocommerce_form_field_text`) (`return ( alg_wc_eu_vat_get_field_id() === $key ) ? $field . '<span style="font-size:smaller !important;">' . '[<a name="billing_eu_vat_number_verify" href="">' . __( 'Verify', 'eu-vat-for-woocommerce' ) . '</a>]' . '</span>' : $field;`)
Expand Down Expand Up @@ -110,12 +110,16 @@ function __construct() {
add_filter( 'wp_enqueue_scripts', array( $this, 'add_place_order_button_confirmation_script' ) );
}

if ( is_admin() ) {
add_filter('woocommerce_order_is_vat_exempt', array( $this, 'admin_order_is_vat_exempt' ), PHP_INT_MAX, 2 );
if ( 'yes' === get_option( 'alg_wc_eu_vat_validate_vat_admin_side', 'no' ) ) {
if ( is_admin() ) {
add_filter('woocommerce_order_is_vat_exempt', array( $this, 'admin_order_is_vat_exempt' ), PHP_INT_MAX, 2 );
}
add_filter('woocommerce_order_is_vat_exempt', array( $this, 'admin_woocommerce_order_is_vat_exempt'), PHP_INT_MAX, 2);
}


add_action( 'admin_print_scripts', array( $this, 'admin_inline_js' ), PHP_INT_MAX );

add_filter('woocommerce_order_is_vat_exempt', array( $this, 'admin_woocommerce_order_is_vat_exempt'), PHP_INT_MAX, 2);

add_action('woocommerce_order_item_add_action_buttons', array( $this, 'admin_function_to_add_the_button'), PHP_INT_MAX);

Expand Down
14 changes: 12 additions & 2 deletions includes/settings/class-alg-wc-eu-vat-settings-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* EU VAT for WooCommerce - Admin Section Settings
*
* @version 2.11.12
* @version 2.12.5
* @since 1.5.0
* @author WPFactory
*/
Expand Down Expand Up @@ -30,7 +30,7 @@ function __construct() {
/**
* get_settings.
*
* @version 2.11.12
* @version 2.12.5
* @since 1.5.0
* @todo [dev] (important) set "Session type" default value to "WC session (recommended)"
*/
Expand Down Expand Up @@ -58,6 +58,16 @@ function get_settings() {
'default' => 'no',
'type' => 'checkbox',
),

array(
'title' => __( 'VAT Validation for Orders Created Manually from the Admin Side', 'eu-vat-for-woocommerce' ),
'desc_tip' => __( 'Validate VAT when an order is created manually from the admin side.', 'eu-vat-for-woocommerce' ),
'desc' => __( 'Enable', 'eu-vat-for-woocommerce' ),
'id' => 'alg_wc_eu_vat_validate_vat_admin_side',
'default' => 'no',
'type' => 'checkbox',
),

array(
'type' => 'sectionend',
'id' => 'alg_wc_eu_vat_admin_options',
Expand Down
Loading

0 comments on commit 6c2e236

Please sign in to comment.