Changeset 3335801
- Timestamp:
- 07/29/2025 09:40:38 AM (8 months ago)
- Location:
- tax-switch-for-woocommerce
- Files:
-
- 98 added
- 7 edited
-
tags/1.5.10 (added)
-
tags/1.5.10/LICENSE.txt (added)
-
tags/1.5.10/README.txt (added)
-
tags/1.5.10/admin (added)
-
tags/1.5.10/admin/class-wdevs-tax-switch-admin.php (added)
-
tags/1.5.10/admin/index.php (added)
-
tags/1.5.10/admin/js (added)
-
tags/1.5.10/admin/js/wdevs-tax-switch-woocommerce.js (added)
-
tags/1.5.10/admin/partials (added)
-
tags/1.5.10/admin/partials/section-wdevs-tax-switch-shortcode.php (added)
-
tags/1.5.10/build (added)
-
tags/1.5.10/build/label (added)
-
tags/1.5.10/build/label/block.json (added)
-
tags/1.5.10/build/label/index-rtl.css (added)
-
tags/1.5.10/build/label/index.asset.php (added)
-
tags/1.5.10/build/label/index.css (added)
-
tags/1.5.10/build/label/index.js (added)
-
tags/1.5.10/build/label/style-index-rtl.css (added)
-
tags/1.5.10/build/label/style-index.css (added)
-
tags/1.5.10/build/label/view.asset.php (added)
-
tags/1.5.10/build/label/view.js (added)
-
tags/1.5.10/build/shared (added)
-
tags/1.5.10/build/shared/shared.asset.php (added)
-
tags/1.5.10/build/shared/shared.js (added)
-
tags/1.5.10/build/switch (added)
-
tags/1.5.10/build/switch/advanced-product-fields-for-woocommerce.asset.php (added)
-
tags/1.5.10/build/switch/advanced-product-fields-for-woocommerce.js (added)
-
tags/1.5.10/build/switch/block.json (added)
-
tags/1.5.10/build/switch/fibofilters.asset.php (added)
-
tags/1.5.10/build/switch/fibofilters.js (added)
-
tags/1.5.10/build/switch/index-rtl.css (added)
-
tags/1.5.10/build/switch/index.asset.php (added)
-
tags/1.5.10/build/switch/index.css (added)
-
tags/1.5.10/build/switch/index.js (added)
-
tags/1.5.10/build/switch/kapee-theme.asset.php (added)
-
tags/1.5.10/build/switch/kapee-theme.js (added)
-
tags/1.5.10/build/switch/product-extras-for-woocommerce.asset.php (added)
-
tags/1.5.10/build/switch/product-extras-for-woocommerce.js (added)
-
tags/1.5.10/build/switch/style-index-rtl.css (added)
-
tags/1.5.10/build/switch/style-index.css (added)
-
tags/1.5.10/build/switch/view.asset.php (added)
-
tags/1.5.10/build/switch/view.js (added)
-
tags/1.5.10/build/switch/woocommerce-measurement-price-calculator.asset.php (added)
-
tags/1.5.10/build/switch/woocommerce-measurement-price-calculator.js (added)
-
tags/1.5.10/build/switch/woocommerce-product-addons.asset.php (added)
-
tags/1.5.10/build/switch/woocommerce-product-addons.js (added)
-
tags/1.5.10/build/switch/woocommerce-quantity-manager.asset.php (added)
-
tags/1.5.10/build/switch/woocommerce-quantity-manager.js (added)
-
tags/1.5.10/build/switch/woocommerce-tiered-price-table.asset.php (added)
-
tags/1.5.10/build/switch/woocommerce-tiered-price-table.js (added)
-
tags/1.5.10/build/switch/yith-woocommerce-product-add-ons.asset.php (added)
-
tags/1.5.10/build/switch/yith-woocommerce-product-add-ons.js (added)
-
tags/1.5.10/includes (added)
-
tags/1.5.10/includes/assets (added)
-
tags/1.5.10/includes/assets/css (added)
-
tags/1.5.10/includes/assets/css/wdevs-tax-switch-shared.css (added)
-
tags/1.5.10/includes/class-wdevs-tax-switch-activator.php (added)
-
tags/1.5.10/includes/class-wdevs-tax-switch-block-label.php (added)
-
tags/1.5.10/includes/class-wdevs-tax-switch-block-shared.php (added)
-
tags/1.5.10/includes/class-wdevs-tax-switch-block-switch.php (added)
-
tags/1.5.10/includes/class-wdevs-tax-switch-block.php (added)
-
tags/1.5.10/includes/class-wdevs-tax-switch-compatibility.php (added)
-
tags/1.5.10/includes/class-wdevs-tax-switch-deactivator.php (added)
-
tags/1.5.10/includes/class-wdevs-tax-switch-loader.php (added)
-
tags/1.5.10/includes/class-wdevs-tax-switch-mini-cart-context.php (added)
-
tags/1.5.10/includes/class-wdevs-tax-switch-woocommerce.php (added)
-
tags/1.5.10/includes/class-wdevs-tax-switch.php (added)
-
tags/1.5.10/includes/index.php (added)
-
tags/1.5.10/includes/trait-wdevs-tax-switch-display.php (added)
-
tags/1.5.10/includes/trait-wdevs-tax-switch-helper.php (added)
-
tags/1.5.10/includes/trait-wdevs-tax-switch-plugins.php (added)
-
tags/1.5.10/languages (added)
-
tags/1.5.10/languages/build.json (added)
-
tags/1.5.10/languages/tax-switch-for-woocommerce-en_US-43dcd1c557291b1a502cbd2ea4d36beb.json (added)
-
tags/1.5.10/languages/tax-switch-for-woocommerce-en_US-a7d03486c29d1d1d1553c783663175ae.json (added)
-
tags/1.5.10/languages/tax-switch-for-woocommerce-en_US.l10n.php (added)
-
tags/1.5.10/languages/tax-switch-for-woocommerce-en_US.mo (added)
-
tags/1.5.10/languages/tax-switch-for-woocommerce-en_US.po (added)
-
tags/1.5.10/languages/tax-switch-for-woocommerce-nl_NL-43dcd1c557291b1a502cbd2ea4d36beb.json (added)
-
tags/1.5.10/languages/tax-switch-for-woocommerce-nl_NL-a7d03486c29d1d1d1553c783663175ae.json (added)
-
tags/1.5.10/languages/tax-switch-for-woocommerce-nl_NL.l10n.php (added)
-
tags/1.5.10/languages/tax-switch-for-woocommerce-nl_NL.mo (added)
-
tags/1.5.10/languages/tax-switch-for-woocommerce-nl_NL.po (added)
-
tags/1.5.10/languages/tax-switch-for-woocommerce-sv_SE-43dcd1c557291b1a502cbd2ea4d36beb.json (added)
-
tags/1.5.10/languages/tax-switch-for-woocommerce-sv_SE-a7d03486c29d1d1d1553c783663175ae.json (added)
-
tags/1.5.10/languages/tax-switch-for-woocommerce-sv_SE.l10n.php (added)
-
tags/1.5.10/languages/tax-switch-for-woocommerce-sv_SE.mo (added)
-
tags/1.5.10/languages/tax-switch-for-woocommerce-sv_SE.po (added)
-
tags/1.5.10/languages/tax-switch-for-woocommerce.pot (added)
-
tags/1.5.10/public (added)
-
tags/1.5.10/public/class-wdevs-tax-switch-public.php (added)
-
tags/1.5.10/public/css (added)
-
tags/1.5.10/public/css/wdevs-tax-switch-public.css (added)
-
tags/1.5.10/public/index.php (added)
-
tags/1.5.10/uninstall.php (added)
-
tags/1.5.10/wdevs-tax-switch.php (added)
-
trunk/README.txt (modified) (3 diffs)
-
trunk/build/label/block.json (modified) (1 diff)
-
trunk/build/shared/shared.asset.php (modified) (1 diff)
-
trunk/build/shared/shared.js (modified) (1 diff)
-
trunk/build/switch/block.json (modified) (1 diff)
-
trunk/build/switch/fibofilters.asset.php (added)
-
trunk/build/switch/fibofilters.js (added)
-
trunk/includes/class-wdevs-tax-switch-compatibility.php (modified) (1 diff)
-
trunk/wdevs-tax-switch.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tax-switch-for-woocommerce/trunk/README.txt
r3332366 r3335801 4 4 Requires at least: 5.0 5 5 Tested up to: 6.8 6 Stable tag: 1.5. 96 Stable tag: 1.5.10 7 7 Requires PHP: 7.2 8 8 License: GPL-2.0+ … … 194 194 * Advanced Woo Search (+ PRO) 195 195 * B2B Market 196 * FiboFilters 196 197 197 198 If 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. … … 230 231 231 232 == Changelog == 233 = 1.5.10 = 234 * Added compatibility for FiboFilters 235 232 236 = 1.5.9 = 233 237 * Added compatibility for Kapee theme -
tax-switch-for-woocommerce/trunk/build/label/block.json
r3332349 r3335801 3 3 "apiVersion": 3, 4 4 "name": "wdevs/tax-switch-label", 5 "version": "1.5. 9",5 "version": "1.5.10", 6 6 "title": "Tax Switch text label", 7 7 "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 3 3 "apiVersion": 3, 4 4 "name": "wdevs/tax-switch", 5 "version": "1.5. 9",5 "version": "1.5.10", 6 6 "title": "Tax Switch for WooCommerce", 7 7 "category": "woocommerce", -
tax-switch-for-woocommerce/trunk/includes/class-wdevs-tax-switch-compatibility.php
r3332349 r3335801 143 143 $wctpt_handle = 'wdevs-tax-switch-woocommerce-tiered-price-table'; 144 144 $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' ]); 145 151 } 146 152 } -
tax-switch-for-woocommerce/trunk/wdevs-tax-switch.php
r3332349 r3335801 17 17 * Plugin URI: https://wijnberg.dev 18 18 * Description: Let customers toggle between inclusive and exclusive VAT pricing in your WooCommerce store. 19 * Version: 1.5. 919 * Version: 1.5.10 20 20 * Author: Wijnberg Developments 21 21 * Author URI: https://wijnberg.dev/ … … 41 41 * Rename this for your plugin and update it as you release new versions. 42 42 */ 43 define( 'WDEVS_TAX_SWITCH_VERSION', '1.5. 9' );43 define( 'WDEVS_TAX_SWITCH_VERSION', '1.5.10' ); 44 44 45 45 /**
Note: See TracChangeset
for help on using the changeset viewer.