Plugin Directory

Changeset 3425544


Ignore:
Timestamp:
12/22/2025 05:19:02 PM (3 months ago)
Author:
wijnbergdevelopments
Message:
  • Skip price wrapping in coupon min/max error messages
Location:
tax-switch-for-woocommerce
Files:
104 added
7 edited

Legend:

Unmodified
Added
Removed
  • tax-switch-for-woocommerce/trunk/CHANGELOG.md

    r3417485 r3425544  
    22All notable changes to the Tax Switch for WooCommerce plugin will be documented in this file.
    33
    4 ## [1.6.4] - 2025-12-08
     4## [1.6.5] - 2025-12-22
     5### Updated
     6- Skip price wrapping in coupon min/max error messages
     7
     8## [1.6.4] - 2025-12-11
    59### Added
    610- Compatibility for YITH WooCommerce Role Based Prices
  • tax-switch-for-woocommerce/trunk/README.txt

    r3417485 r3425544  
    44Requires at least: 5.0
    55Tested up to: 6.9
    6 Stable tag: 1.6.4
     6Stable tag: 1.6.5
    77Requires PHP: 7.2
    88License: GPL-2.0+
     
    242242
    243243== Changelog ==
     244= 1.6.5 =
     245* Skip price wrapping in coupon min/max error messages
     246
    244247= 1.6.4 =
    245248* Added compatibility for YITH WooCommerce Role Based Prices
  • tax-switch-for-woocommerce/trunk/build/label/block.json

    r3417485 r3425544  
    33  "apiVersion": 3,
    44  "name": "wdevs/tax-switch-label",
    5   "version": "1.6.4",
     5  "version": "1.6.5",
    66  "title": "Tax Switch text label",
    77  "category": "woocommerce",
  • tax-switch-for-woocommerce/trunk/build/switch/block.json

    r3417485 r3425544  
    33  "apiVersion": 3,
    44  "name": "wdevs/tax-switch",
    5   "version": "1.6.4",
     5  "version": "1.6.5",
    66  "title": "Tax Switch for WooCommerce",
    77  "category": "woocommerce",
  • tax-switch-for-woocommerce/trunk/includes/class-wdevs-tax-switch.php

    r3417485 r3425544  
    215215            $this->loader->add_filter( 'woocommerce_countries_inc_tax_or_vat', $plugin_public, 'wrap_inc_label', PHP_INT_MAX, 1 );
    216216            $this->loader->add_filter( 'woocommerce_countries_ex_tax_or_vat', $plugin_public, 'wrap_ex_label', PHP_INT_MAX, 1 );
     217            $this->loader->add_filter( 'woocommerce_coupon_get_minimum_amount', $plugin_public, 'is_coupon_error_message', 10, 1 );
     218            $this->loader->add_filter( 'woocommerce_coupon_get_maximum_amount', $plugin_public, 'is_coupon_error_message', 10, 1 );
    217219
    218220            // B2B Market
  • tax-switch-for-woocommerce/trunk/public/class-wdevs-tax-switch-public.php

    r3402617 r3425544  
    4444
    4545    /**
     46     * Skip wrapping the next wc_price() call.
     47     *
     48     * @since 1.6.5
     49     * @var bool
     50     */
     51    private $skip_next_wc_price_wrap = false;
     52
     53    /**
    4654     * Initialize the class and set its properties.
    4755     *
     
    8593
    8694        if ( $this->is_file_context() ) {
     95            return $return;
     96        }
     97
     98        if ( $this->should_skip_next_price_wrap() ) {
    8799            return $return;
    88100        }
     
    224236     */
    225237    private function should_be_disabled_in_action() {
    226 
    227238        //compatibility with YITH WooCommerce Product Add Ons select
    228239        if ( did_filter( 'yith_wapo_option_price' ) ) {
     
    238249    }
    239250
     251    /**
     252     * Disable price wrapping in coupon error messages.
     253     * Reason 1: mostly called from cart/checkout. Reason 2: HTML is stripped from these messages.
     254     *
     255     * @param mixed $amount Coupon amount.
     256     * @return mixed
     257     * @since 1.6.5
     258     */
     259    public function is_coupon_error_message( $amount ) {
     260        $this->skip_next_wc_price_wrap = true;
     261        return $amount;
     262    }
     263
     264    /**
     265     * Check if the next wc_price() call should be skipped.
     266     *
     267     * @return bool
     268     * @since 1.6.5
     269     */
     270    public function should_skip_next_price_wrap() {
     271        if ( $this->skip_next_wc_price_wrap ) {
     272            $this->skip_next_wc_price_wrap = false;
     273            return true;
     274        }
     275
     276        return false;
     277    }
     278
    240279}
  • tax-switch-for-woocommerce/trunk/wdevs-tax-switch.php

    r3417485 r3425544  
    1717 * Plugin URI:           https://wijnberg.dev
    1818 * Description:          Let customers toggle between inclusive and exclusive VAT pricing in your WooCommerce store.
    19  * Version:              1.6.4
     19 * Version:              1.6.5
    2020 * Author:               Wijnberg Developments
    2121 * Author URI:           https://wijnberg.dev/
     
    4141 * Rename this for your plugin and update it as you release new versions.
    4242 */
    43 define( 'WDEVS_TAX_SWITCH_VERSION', '1.6.4' );
     43define( 'WDEVS_TAX_SWITCH_VERSION', '1.6.5' );
    4444
    4545/**
Note: See TracChangeset for help on using the changeset viewer.