Plugin Directory

Changeset 3417485


Ignore:
Timestamp:
12/11/2025 02:47:03 PM (4 months ago)
Author:
wijnbergdevelopments
Message:
  • Added compatibility for YITH WooCommerce Role Based Prices
Location:
tax-switch-for-woocommerce
Files:
104 added
9 edited

Legend:

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

    r3410740 r3417485  
    11# Changelog
    22All notable changes to the Tax Switch for WooCommerce plugin will be documented in this file.
     3
     4## [1.6.4] - 2025-12-08
     5### Added
     6- Compatibility for YITH WooCommerce Role Based Prices
    37
    48## [1.6.3] - 2025-12-04
  • tax-switch-for-woocommerce/trunk/README.md

    r3410740 r3417485  
    220220- LiteSpeed Cache
    221221- Elementor Pro
     222- YITH WooCommerce Role Based Prices
    222223
    223224If you encounter any conflicts with other themes or plugins, please report them by opening an issue or through our website.
  • tax-switch-for-woocommerce/trunk/README.txt

    r3410740 r3417485  
    44Requires at least: 5.0
    55Tested up to: 6.9
    6 Stable tag: 1.6.3
     6Stable tag: 1.6.4
    77Requires PHP: 7.2
    88License: GPL-2.0+
     
    205205* LiteSpeed Cache
    206206* Elementor Pro
     207* YITH WooCommerce Role Based Prices
    207208
    208209If you encounter any compatibility issues with other plugins or themes, please let us know. Your feedback helps us improve the plugin and extend compatibility to more third-party solutions.
     
    241242
    242243== Changelog ==
     244= 1.6.4 =
     245* Added compatibility for YITH WooCommerce Role Based Prices
     246
    243247= 1.6.3 =
    244248* Added new style: `flat pill`
  • tax-switch-for-woocommerce/trunk/build/label/block.json

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

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

    r3405724 r3417485  
    402402    }
    403403
     404    /**
     405     * Wrap YITH Role Based Prices suffix with alternate tax display.
     406     *
     407     * @param string                         $suffix Existing suffix HTML.
     408     * @param YITH_Role_Based_Prices_Product $yith_product Instance used by YITH.
     409     *
     410     * @return string
     411     * @since 1.6.4
     412     */
     413    public function wrap_yith_price_suffix( $suffix, $yith_product ) {
     414        if ( empty( trim( $suffix ) ) ) {
     415            return $suffix;
     416        }
     417
     418        if ( str_contains( $suffix, 'wts-price-wrapper' ) || str_contains( $suffix, 'wts-price-container' ) ) {
     419            return $suffix;
     420            }
     421
     422        if ( $this->should_hide_on_current_page() ) {
     423            return $suffix;
     424        }
     425
     426        $shop_prices_include_tax = $this->shop_displays_price_including_tax_by_default();
     427
     428        // Get VAT text options
     429        $incl_vat_text = $this->get_option_text( 'wdevs_tax_switch_incl_vat', __( 'Incl. VAT', 'tax-switch-for-woocommerce' ) );
     430        $excl_vat_text = $this->get_option_text( 'wdevs_tax_switch_excl_vat', __( 'Excl. VAT', 'tax-switch-for-woocommerce' ) );
     431
     432        if ( $shop_prices_include_tax ) {
     433            $vat_text           = $incl_vat_text;
     434            $alternate_vat_text = $excl_vat_text;
     435        } else {
     436            $vat_text           = $excl_vat_text;
     437            $alternate_vat_text = $incl_vat_text;
     438        }
     439
     440        $html = $this->wrap_price_displays( '', $shop_prices_include_tax, $vat_text, $alternate_vat_text );
     441
     442        return $html;
     443    }
     444
    404445}
  • tax-switch-for-woocommerce/trunk/includes/class-wdevs-tax-switch.php

    r3405724 r3417485  
    355355                $this->loader->add_filter( 'wdevs_tax_switch_current_product', $plugin_compatibility, 'set_product_for_woocommerce_product_bundles', 10, 1 );
    356356            }
     357
     358            // YITH WooCommerce Role Based Prices
     359            if ( $this->is_plugin_active( 'yith-woocommerce-role-based-prices-premium/init.php' ) ) {
     360                $this->loader->add_filter(
     361                    'yith_role_based_prices_get_price_suffix',
     362                    $plugin_compatibility,
     363                    'wrap_yith_price_suffix',
     364                    PHP_INT_MAX,
     365                    2
     366                );
     367            }
    357368        }
    358369    }
  • tax-switch-for-woocommerce/trunk/includes/trait-wdevs-tax-switch-display.php

    r3277044 r3417485  
    5959
    6060        return sprintf(
    61             '<span class="wts-price-container">%s <span class="wts-price-wrapper"><span class="%s wts-active" ><span class="wts-vat-text">%s</span></span><span class="%s wts-inactive"><span class="wts-vat-text">%s</span></span></span></span>',
     61            '<span class="wts-price-container">%s <span class="wts-price-wrapper"><span class="%s wts-active"><span class="wts-vat-text">%s</span></span><span class="%s wts-inactive"><span class="wts-vat-text">%s</span></span></span></span>',
    6262            $price_html,
    6363            $classes[0],
  • tax-switch-for-woocommerce/trunk/wdevs-tax-switch.php

    r3410740 r3417485  
    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.3
     19 * Version:              1.6.4
    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.3' );
     43define( 'WDEVS_TAX_SWITCH_VERSION', '1.6.4' );
    4444
    4545/**
Note: See TracChangeset for help on using the changeset viewer.