Plugin Directory

Changeset 3335801


Ignore:
Timestamp:
07/29/2025 09:40:38 AM (8 months ago)
Author:
wijnbergdevelopments
Message:

Added compatibility for FiboFilters

Location:
tax-switch-for-woocommerce
Files:
98 added
7 edited

Legend:

Unmodified
Added
Removed
  • tax-switch-for-woocommerce/trunk/README.txt

    r3332366 r3335801  
    44Requires at least: 5.0
    55Tested up to: 6.8
    6 Stable tag: 1.5.9
     6Stable tag: 1.5.10
    77Requires PHP: 7.2
    88License: GPL-2.0+
     
    194194* Advanced Woo Search (+ PRO)
    195195* B2B Market
     196* FiboFilters
    196197
    197198If 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.
     
    230231
    231232== Changelog ==
     233= 1.5.10 =
     234* Added compatibility for FiboFilters
     235
    232236= 1.5.9 =
    233237* Added compatibility for Kapee theme
  • tax-switch-for-woocommerce/trunk/build/label/block.json

    r3332349 r3335801  
    33  "apiVersion": 3,
    44  "name": "wdevs/tax-switch-label",
    5   "version": "1.5.9",
     5  "version": "1.5.10",
    66  "title": "Tax Switch text label",
    77  "category": "woocommerce",
  • tax-switch-for-woocommerce/trunk/build/shared/shared.asset.php

    r3307210 r3335801  
    1 <?php return array('dependencies' => array(), 'version' => '7ce5debd17550ab9b3c4');
     1<?php return array('dependencies' => array(), 'version' => '24f116663efc3b8045d8');
  • tax-switch-for-woocommerce/trunk/build/shared/shared.js

    r3307210 r3335801  
    1 "use strict";(globalThis.webpackChunkwdevs_tax_switch=globalThis.webpackChunkwdevs_tax_switch||[]).push([[320],{67:(t,e,s)=>{s.d(e,{A:()=>o});var i=s(87),c=s(143),n=s(159),l=s(75),a=s(790);class r extends i.Component{constructor(t){super(t);const{readOnly:e,isSwitched:s}=this.getInitialState(t);this.state={readOnly:e,isSwitched:s},this.unsubscribe=(0,c.subscribe)((()=>{const t=(0,l.ir)();this.state.isSwitched!==t&&this.setState({isSwitched:t})}))}getInitialState(t){const e=n.A.parseBooleanValue(t.readOnly),s=t.originalTaxDisplay||"incl";let i;return i=e?!("incl"===s):(0,l.ir)(),{readOnly:e,isSwitched:i}}componentWillUnmount(){this.unsubscribe&&this.unsubscribe()}displayIncludingVat(){const{originalTaxDisplay:t="incl"}=this.props,{isSwitched:e}=this.state;return n.A.displayIncludingVat(t,e)}getCurrentLabel(){const{labelTextIncl:t,labelTextExcl:e}=this.props;return this.displayIncludingVat()?t||"":e||""}render(){const{labelTextColor:t,labelTextColorChecked:e,labelTextIncl:s,labelTextExcl:i}=this.props;if(!s&&!i)return"";const c=this.displayIncludingVat();return(0,a.jsx)("span",{className:"wdevs-tax-switch-labels "+(c?"wts-price-incl":"wts-price-excl"),style:{"--wts-text-color":t,"--wts-text-color-checked":e},children:(0,a.jsx)("span",{className:"wdevs-tax-switch-label-text",children:this.getCurrentLabel()})})}}const o=/^(38|733)$/.test(s.j)?r:null},75:(t,e,s)=>{s.d(e,{WJ:()=>d,ir:()=>o,rj:()=>h});var i=s(143);const c="wdevs_tax_switch_is_switched",n="wdevs-tax-switch/store",l="SET_IS_SWITCHED",a={setIsSwitched:t=>({type:l,value:t}),saveIsSwitched:t=>(localStorage.setItem(c,JSON.stringify(t)),{type:l,value:t})};let r=(0,i.select)(n);function o(){return(0,i.select)(n).getIsSwitched()}function h(t){return(0,i.dispatch)(n).saveIsSwitched(t)}function d(t){return(0,i.dispatch)(n).setIsSwitched(t)}void 0===r&&(r=(0,i.createReduxStore)(n,{reducer:(t=(()=>{const t=localStorage.getItem(c);return{isSwitched:!!t&&JSON.parse(t)}})(),e)=>e.type===l?{...t,isSwitched:e.value}:t,actions:a,selectors:{getIsSwitched:t=>t.isSwitched}}),(0,i.register)(r))},159:(t,e,s)=>{s.d(e,{A:()=>c});var i=s(75);const c=class{static togglePriceClasses(t,e){const s=this.displayIncludingVat(t,e);document.querySelectorAll(".wts-price-wrapper").forEach((t=>{const e=t.querySelector(":scope > .wts-price-incl"),i=t.querySelector(":scope > .wts-price-excl");s?(e.classList.remove("wts-inactive"),e.classList.add("wts-active"),i.classList.remove("wts-active"),i.classList.add("wts-inactive")):(e.classList.remove("wts-active"),e.classList.add("wts-inactive"),i.classList.remove("wts-inactive"),i.classList.add("wts-active"))}))}static displayIncludingVat(t,e){return null==e&&(e=(0,i.ir)()),"incl"===t&&!e||"excl"===t&&e}static parseBooleanValue(t){return!!t&&JSON.parse(t)}static setPriceClasses(t){return this.togglePriceClasses(t,(0,i.ir)())}static calculateAlternatePrice(t,e,s){if(!t||t<=0||!s)return t;const i=1+s/100;let c;return c="incl"===e?t/i:t*i,Number(c.toFixed(2))}}},538:(t,e,s)=>{function i(){return!(window.wtsViewObject||{checkPriceElements:!1}).checkPriceElements||document.querySelectorAll(".wts-price-wrapper").length>0}s.d(e,{I:()=>i})},651:(t,e,s)=>{s.d(e,{A:()=>i});const i=/^([29]02|38|733|793)$/.test(s.j)?null:class{constructor(t){this.originalTaxDisplay=t}build(t,e,s,i=null){const c=this.getPricesBasedOnTaxDisplay(e,s),n=c.including,l=c.excluding;function a(t){return t?"wts-active":"wts-inactive"}function r(e,s){return`\n         <span class="wts-price-${s?"incl":"excl"} ${a(s===t)}">\n            ${e}\n         </span>\n      `}let o=`\n      <span class="wts-price-container">\n         <span class="wts-price-wrapper">\n            ${r(n,!0)}\n            ${r(l,!1)}\n         </span>\n   `;if(i){function h(e,s){return`\n            <span class="wts-price-${s?"incl":"excl"} ${a(s===t)}">\n               ${e}\n            </span>\n         `}o+=`\n         <span class="wts-price-wrapper">\n            ${h(i.including,!0)}\n            ${h(i.excluding,!1)}\n         </span>\n      `}return o+="</span>",o.trim()}getPricesBasedOnTaxDisplay(t,e){return"incl"===this.originalTaxDisplay?{including:t,excluding:e}:{including:e,excluding:t}}static getVatTexts(t=null){const e=document.createTextNode(" ").nodeValue;let s,i;if(t){const c=jQuery(t);if(s=c.find(".wts-price-incl .wts-vat-text").first(),i=c.find(".wts-price-excl .wts-vat-text").first(),s.length||i.length)return{including:s.length?e+s.clone().prop("outerHTML"):"",excluding:i.length?e+i.clone().prop("outerHTML"):""}}return s=jQuery(".wts-price-wrapper .wts-price-incl .wts-vat-text").first(),i=jQuery(".wts-price-wrapper .wts-price-excl .wts-vat-text").first(),{including:s.length?e+s.clone().prop("outerHTML"):"",excluding:i.length?e+i.clone().prop("outerHTML"):""}}static getVatTextElement(t,e,s){return`<span class="wts-price-wrapper">\n                    <span class="wts-price-incl ${t?"wts-active":"wts-inactive"}">\n                        ${e}\n                    </span>\n                    <span class="wts-price-excl ${t?"wts-inactive":"wts-active"}">\n                          ${s}\n                    </span>\n                </span>\n            `}}},983:(t,e,s)=>{s.d(e,{A:()=>o});var i=s(87),c=s(143),n=s(159),l=s(75),a=s(790);class r extends i.Component{constructor(t){super(t);const{readOnly:e,isSwitched:s}=this.getInitialState(t);this.state={readOnly:e,isSwitched:s},this.handleChange=this.handleChange.bind(this),this.unsubscribe=(0,c.subscribe)((()=>{const t=(0,l.ir)();this.state.isSwitched!==t&&this.setState({isSwitched:t})}))}getInitialState(t){const e=n.A.parseBooleanValue(t.readOnly),s=t.originalTaxDisplay||"incl";let i;return i=e?!("incl"===s):(0,l.ir)(),{readOnly:e,isSwitched:i}}componentWillUnmount(){this.unsubscribe&&this.unsubscribe()}handleChange(){const t=!this.state.isSwitched;this.setState({isSwitched:t},(()=>{this.state.readOnly?(0,l.WJ)(t):((0,l.rj)(t),this.fireSwitchChangeEvent(t)),this.togglePriceClasses()}))}displayIncludingVat(){const{originalTaxDisplay:t="incl"}=this.props,{isSwitched:e}=this.state;return n.A.displayIncludingVat(t,e)}togglePriceClasses(){const{originalTaxDisplay:t="incl"}=this.props,{isSwitched:e}=this.state;return n.A.togglePriceClasses(t,e)}getCurrentLabel(){const{switchLabelIncl:t,switchLabelExcl:e}=this.props;return this.displayIncludingVat()?t||"":e||""}fireSwitchChangeEvent(t){const e=new CustomEvent("wdevs-tax-switch-changed",{detail:{isSwitched:t,displayIncludingVat:this.displayIncludingVat()}});document.dispatchEvent(e)}renderButtons(){const{switchColor:t,switchColorChecked:e,switchBackgroundColor:s,switchBackgroundColorChecked:i,switchTextColor:c,switchLabelIncl:n,switchLabelExcl:l}=this.props,r=this.displayIncludingVat();return(0,a.jsxs)("div",{className:"wdevs-tax-switch wdevs-tax-buttons",style:{"--wts-color":t,"--wts-color-checked":e,"--wts-bg-color":s,"--wts-bg-color-checked":i,"--wts-text-color":c},children:[(0,a.jsx)("button",{type:"button",className:"wdevs-tax-button "+(r?"wdevs-tax-button-active":""),onClick:()=>{r||this.handleChange()},children:n||"Incl. VAT"}),(0,a.jsx)("button",{type:"button",className:"wdevs-tax-button "+(r?"":"wdevs-tax-button-active"),onClick:()=>{r&&this.handleChange()},children:l||"Excl. VAT"})]})}renderToggleSwitch(){const{switchColor:t,switchColorChecked:e,switchBackgroundColor:s,switchBackgroundColorChecked:i,switchTextColor:c,switchLabelIncl:n,switchLabelExcl:l}=this.props,r=this.displayIncludingVat(),o=n||l;return(0,a.jsxs)("div",{className:"wdevs-tax-switch",style:{"--wts-color":t,"--wts-color-checked":e,"--wts-bg-color":s,"--wts-bg-color-checked":i,"--wts-text-color":c},children:[(0,a.jsxs)("label",{className:"wdevs-tax-switch-label",children:[(0,a.jsx)("input",{type:"checkbox",name:"wdevs-tax-switch-checkbox",onChange:this.handleChange,checked:r,className:"wdevs-tax-switch-checkbox"}),(0,a.jsx)("span",{className:"wdevs-tax-switch-slider"})]}),o&&(0,a.jsx)("span",{className:"wdevs-tax-switch-label-text",onClick:this.handleChange,children:this.getCurrentLabel()})]})}render(){const{switchType:t="switch"}=this.props;return"buttons"===t?this.renderButtons():this.renderToggleSwitch()}}const o=/^(202|793)$/.test(s.j)?r:null}}]);
     1"use strict";(globalThis.webpackChunkwdevs_tax_switch=globalThis.webpackChunkwdevs_tax_switch||[]).push([[320],{67:(t,e,s)=>{s.d(e,{A:()=>o});var i=s(87),c=s(143),n=s(159),l=s(75),a=s(790);class r extends i.Component{constructor(t){super(t);const{readOnly:e,isSwitched:s}=this.getInitialState(t);this.state={readOnly:e,isSwitched:s},this.unsubscribe=(0,c.subscribe)((()=>{const t=(0,l.ir)();this.state.isSwitched!==t&&this.setState({isSwitched:t})}))}getInitialState(t){const e=n.A.parseBooleanValue(t.readOnly),s=t.originalTaxDisplay||"incl";let i;return i=e?!("incl"===s):(0,l.ir)(),{readOnly:e,isSwitched:i}}componentWillUnmount(){this.unsubscribe&&this.unsubscribe()}displayIncludingVat(){const{originalTaxDisplay:t="incl"}=this.props,{isSwitched:e}=this.state;return n.A.displayIncludingVat(t,e)}getCurrentLabel(){const{labelTextIncl:t,labelTextExcl:e}=this.props;return this.displayIncludingVat()?t||"":e||""}render(){const{labelTextColor:t,labelTextColorChecked:e,labelTextIncl:s,labelTextExcl:i}=this.props;if(!s&&!i)return"";const c=this.displayIncludingVat();return(0,a.jsx)("span",{className:"wdevs-tax-switch-labels "+(c?"wts-price-incl":"wts-price-excl"),style:{"--wts-text-color":t,"--wts-text-color-checked":e},children:(0,a.jsx)("span",{className:"wdevs-tax-switch-label-text",children:this.getCurrentLabel()})})}}const o=/^(38|733)$/.test(s.j)?r:null},75:(t,e,s)=>{s.d(e,{WJ:()=>d,ir:()=>o,rj:()=>h});var i=s(143);const c="wdevs_tax_switch_is_switched",n="wdevs-tax-switch/store",l="SET_IS_SWITCHED",a={setIsSwitched:t=>({type:l,value:t}),saveIsSwitched:t=>(localStorage.setItem(c,JSON.stringify(t)),{type:l,value:t})};let r=(0,i.select)(n);function o(){return(0,i.select)(n).getIsSwitched()}function h(t){return(0,i.dispatch)(n).saveIsSwitched(t)}function d(t){return(0,i.dispatch)(n).setIsSwitched(t)}void 0===r&&(r=(0,i.createReduxStore)(n,{reducer:(t=(()=>{const t=localStorage.getItem(c);return{isSwitched:!!t&&JSON.parse(t)}})(),e)=>e.type===l?{...t,isSwitched:e.value}:t,actions:a,selectors:{getIsSwitched:t=>t.isSwitched}}),(0,i.register)(r))},159:(t,e,s)=>{s.d(e,{A:()=>c});var i=s(75);const c=class{static togglePriceClasses(t,e){const s=this.displayIncludingVat(t,e);document.querySelectorAll(".wts-price-wrapper").forEach((t=>{const e=t.querySelector(":scope > .wts-price-incl"),i=t.querySelector(":scope > .wts-price-excl");s?(e.classList.remove("wts-inactive"),e.classList.add("wts-active"),i.classList.remove("wts-active"),i.classList.add("wts-inactive")):(e.classList.remove("wts-active"),e.classList.add("wts-inactive"),i.classList.remove("wts-inactive"),i.classList.add("wts-active"))}))}static displayIncludingVat(t,e){return null==e&&(e=(0,i.ir)()),"incl"===t&&!e||"excl"===t&&e}static parseBooleanValue(t){return!!t&&JSON.parse(t)}static setPriceClasses(t){return this.togglePriceClasses(t,(0,i.ir)())}static calculateAlternatePrice(t,e,s){if(!t||t<=0||!s)return t;const i=1+s/100;let c;return c="incl"===e?t/i:t*i,Number(c.toFixed(2))}}},538:(t,e,s)=>{function i(){return!(window.wtsViewObject||{checkPriceElements:!1}).checkPriceElements||document.querySelectorAll(".wts-price-wrapper").length>0}s.d(e,{I:()=>i})},651:(t,e,s)=>{s.d(e,{A:()=>i});const i=/^([29]02|38|657|733|793)$/.test(s.j)?null:class{constructor(t){this.originalTaxDisplay=t}build(t,e,s,i=null){const c=this.getPricesBasedOnTaxDisplay(e,s),n=c.including,l=c.excluding;function a(t){return t?"wts-active":"wts-inactive"}function r(e,s){return`\n         <span class="wts-price-${s?"incl":"excl"} ${a(s===t)}">\n            ${e}\n         </span>\n      `}let o=`\n      <span class="wts-price-container">\n         <span class="wts-price-wrapper">\n            ${r(n,!0)}\n            ${r(l,!1)}\n         </span>\n   `;if(i){function h(e,s){return`\n            <span class="wts-price-${s?"incl":"excl"} ${a(s===t)}">\n               ${e}\n            </span>\n         `}o+=`\n         <span class="wts-price-wrapper">\n            ${h(i.including,!0)}\n            ${h(i.excluding,!1)}\n         </span>\n      `}return o+="</span>",o.trim()}getPricesBasedOnTaxDisplay(t,e){return"incl"===this.originalTaxDisplay?{including:t,excluding:e}:{including:e,excluding:t}}static getVatTexts(t=null){const e=document.createTextNode(" ").nodeValue;let s,i;if(t){const c=jQuery(t);if(s=c.find(".wts-price-incl .wts-vat-text").first(),i=c.find(".wts-price-excl .wts-vat-text").first(),s.length||i.length)return{including:s.length?e+s.clone().prop("outerHTML"):"",excluding:i.length?e+i.clone().prop("outerHTML"):""}}return s=jQuery(".wts-price-wrapper .wts-price-incl .wts-vat-text").first(),i=jQuery(".wts-price-wrapper .wts-price-excl .wts-vat-text").first(),{including:s.length?e+s.clone().prop("outerHTML"):"",excluding:i.length?e+i.clone().prop("outerHTML"):""}}static getVatTextElement(t,e,s){return`<span class="wts-price-wrapper">\n                    <span class="wts-price-incl ${t?"wts-active":"wts-inactive"}">\n                        ${e}\n                    </span>\n                    <span class="wts-price-excl ${t?"wts-inactive":"wts-active"}">\n                          ${s}\n                    </span>\n                </span>\n            `}}},983:(t,e,s)=>{s.d(e,{A:()=>o});var i=s(87),c=s(143),n=s(159),l=s(75),a=s(790);class r extends i.Component{constructor(t){super(t);const{readOnly:e,isSwitched:s}=this.getInitialState(t);this.state={readOnly:e,isSwitched:s},this.handleChange=this.handleChange.bind(this),this.unsubscribe=(0,c.subscribe)((()=>{const t=(0,l.ir)();this.state.isSwitched!==t&&this.setState({isSwitched:t})}))}getInitialState(t){const e=n.A.parseBooleanValue(t.readOnly),s=t.originalTaxDisplay||"incl";let i;return i=e?!("incl"===s):(0,l.ir)(),{readOnly:e,isSwitched:i}}componentWillUnmount(){this.unsubscribe&&this.unsubscribe()}handleChange(){const t=!this.state.isSwitched;this.setState({isSwitched:t},(()=>{this.state.readOnly?(0,l.WJ)(t):((0,l.rj)(t),this.fireSwitchChangeEvent(t)),this.togglePriceClasses()}))}displayIncludingVat(){const{originalTaxDisplay:t="incl"}=this.props,{isSwitched:e}=this.state;return n.A.displayIncludingVat(t,e)}togglePriceClasses(){const{originalTaxDisplay:t="incl"}=this.props,{isSwitched:e}=this.state;return n.A.togglePriceClasses(t,e)}getCurrentLabel(){const{switchLabelIncl:t,switchLabelExcl:e}=this.props;return this.displayIncludingVat()?t||"":e||""}fireSwitchChangeEvent(t){const e=new CustomEvent("wdevs-tax-switch-changed",{detail:{isSwitched:t,displayIncludingVat:this.displayIncludingVat()}});document.dispatchEvent(e)}renderButtons(){const{switchColor:t,switchColorChecked:e,switchBackgroundColor:s,switchBackgroundColorChecked:i,switchTextColor:c,switchLabelIncl:n,switchLabelExcl:l}=this.props,r=this.displayIncludingVat();return(0,a.jsxs)("div",{className:"wdevs-tax-switch wdevs-tax-buttons",style:{"--wts-color":t,"--wts-color-checked":e,"--wts-bg-color":s,"--wts-bg-color-checked":i,"--wts-text-color":c},children:[(0,a.jsx)("button",{type:"button",className:"wdevs-tax-button "+(r?"wdevs-tax-button-active":""),onClick:()=>{r||this.handleChange()},children:n||"Incl. VAT"}),(0,a.jsx)("button",{type:"button",className:"wdevs-tax-button "+(r?"":"wdevs-tax-button-active"),onClick:()=>{r&&this.handleChange()},children:l||"Excl. VAT"})]})}renderToggleSwitch(){const{switchColor:t,switchColorChecked:e,switchBackgroundColor:s,switchBackgroundColorChecked:i,switchTextColor:c,switchLabelIncl:n,switchLabelExcl:l}=this.props,r=this.displayIncludingVat(),o=n||l;return(0,a.jsxs)("div",{className:"wdevs-tax-switch",style:{"--wts-color":t,"--wts-color-checked":e,"--wts-bg-color":s,"--wts-bg-color-checked":i,"--wts-text-color":c},children:[(0,a.jsxs)("label",{className:"wdevs-tax-switch-label",children:[(0,a.jsx)("input",{type:"checkbox",name:"wdevs-tax-switch-checkbox",onChange:this.handleChange,checked:r,className:"wdevs-tax-switch-checkbox"}),(0,a.jsx)("span",{className:"wdevs-tax-switch-slider"})]}),o&&(0,a.jsx)("span",{className:"wdevs-tax-switch-label-text",onClick:this.handleChange,children:this.getCurrentLabel()})]})}render(){const{switchType:t="switch"}=this.props;return"buttons"===t?this.renderButtons():this.renderToggleSwitch()}}const o=/^(202|793)$/.test(s.j)?r:null}}]);
  • tax-switch-for-woocommerce/trunk/build/switch/block.json

    r3332349 r3335801  
    33  "apiVersion": 3,
    44  "name": "wdevs/tax-switch",
    5   "version": "1.5.9",
     5  "version": "1.5.10",
    66  "title": "Tax Switch for WooCommerce",
    77  "category": "woocommerce",
  • tax-switch-for-woocommerce/trunk/includes/class-wdevs-tax-switch-compatibility.php

    r3332349 r3335801  
    143143            $wctpt_handle = 'wdevs-tax-switch-woocommerce-tiered-price-table';
    144144            $wctpt_asset = $this->enqueue_script($wctpt_handle, 'switch', 'woocommerce-tiered-price-table');
     145        }
     146
     147        // FiboFilters
     148        if ( $this->is_plugin_active( 'fibofilters-pro/fibofilters.php' ) ) {
     149            $ffilters_handle = 'wdevs-tax-switch-fibofilters';
     150            $ffilters_asset = $this->enqueue_script($ffilters_handle, 'switch', 'fibofilters', [ 'fibofilters' ]);
    145151        }
    146152    }
  • tax-switch-for-woocommerce/trunk/wdevs-tax-switch.php

    r3332349 r3335801  
    1717 * Plugin URI:           https://wijnberg.dev
    1818 * Description:          Let customers toggle between inclusive and exclusive VAT pricing in your WooCommerce store.
    19  * Version:              1.5.9
     19 * Version:              1.5.10
    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.5.9' );
     43define( 'WDEVS_TAX_SWITCH_VERSION', '1.5.10' );
    4444
    4545/**
Note: See TracChangeset for help on using the changeset viewer.