Skip to content

Commit

Permalink
Added compatibility for JetEngine Listing Grid 'infinity scroll'
Browse files Browse the repository at this point in the history
  • Loading branch information
Paulsky committed Nov 6, 2024
1 parent 7717773 commit 66b170f
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 20 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog
All notable changes to the Tax Switch for Woocommerce plugin will be documented in this file.

## [1.1.10] - 2024-11-05
### Added
- Compatibility for JetEngine Listing Grid 'infinity scroll'

## [1.1.9] - 2024-11-04
### Added
- Extra check for filtering backend and frontend AJAX requests (which adds compatibility for [PDF Invoices & Packing Slips for WooCommerce](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/)).
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Tax Switch for WooCommerce

Enhances WooCommerce by allowing users to toggle between displaying prices including or excluding VAT. This plugin adds a customizable switch on product pages and provides a flexible way to display both price versions.
Enhances WooCommerce by allowing users to toggle between displaying prices including or excluding VAT. This plugin adds a customizable switch component and provides a flexible way to display both price versions.

<br/>
<img src="https://github.com/user-attachments/assets/a76b1145-b4c2-4ff8-83c1-2d721caefaa7" width="300" alt="Tax Switch for WooCommerce demo" style="max-width: 300px !important; height: auto !important;" />
Expand Down
9 changes: 6 additions & 3 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ Contributors: wijnbergdevelopments
Tags: woocommerce, tax, vat
Requires at least: 5.0
Tested up to: 6.6
Stable tag: 1.1.9
Stable tag: 1.1.10
Requires PHP: 7.2
License: GPL-2.0+
License URI: http://www.gnu.org/licenses/gpl-2.0.txt

Let customers toggle between inclusive and exclusive VAT pricing in your WooCommerce store.

== Description ==

Tax Switch for WooCommerce enhances your WooCommerce store by allowing users to toggle between displaying prices including or excluding VAT. This plugin adds a customizable switch on product pages and provides a flexible way to display both price versions.
Tax Switch for WooCommerce enhances your WooCommerce store by allowing users to toggle between displaying prices including or excluding VAT. This plugin adds a customizable switch component and provides a flexible way to display both price versions.

Key features:

* Display customizable switches where you want
* Gutenberg block support
* Shortcode for easy integration
* Flexible display options for prices with and without VAT
* Saves the state of the switch for the user

For more information about this plugin, please visit the [plugin page](https://products.wijnberg.dev/product/wordpress/plugins/tax-switch-for-woocommerce/).

Expand Down Expand Up @@ -77,6 +77,9 @@ You can also use this shortcode in your theme files with the do_shortcode() func
Some WooCommerce Blocks are not fully compatible with this plugin as they do not use standard WooCommerce filters for price display. This is a known limitation of WooCommerce Blocks and not specific to this plugin. You can fix this by using WooCommerce shortcodes instead of the WooCommerce Blocks.

== Changelog ==
= 1.1.10 =
* Added compatibility for JetEngine Listing Grid 'infinity scroll'

= 1.1.9 =
* Added extra check for filtering backend and frontend AJAX requests (which adds compatibility for [PDF Invoices & Packing Slips for WooCommerce](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/))
* Fixed a bug where the admin request checks failed when Wordpress is installed in a subdirectory
Expand Down
2 changes: 1 addition & 1 deletion block/src/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "wdevs/tax-switch",
"version": "1.1.9",
"version": "1.1.10",
"title": "Tax Switch for WooCommerce",
"category": "woocommerce",
"icon": "money-alt",
Expand Down
36 changes: 24 additions & 12 deletions block/src/includes/ThirdPartyCompatibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,32 @@ class ThirdPartyCompatibility {
} );

jQuery( document ).ajaxSuccess( function ( event, xhr, settings ) {
const methods = [
'get_variable_product_bulk_table', //Flycart Discount Rules for WooCommerce compatibility
];

const isMethodMatched = methods.some( ( method ) =>
settings.data.includes( method )
);

if ( isMethodMatched ) {
setTimeout( function () {
TaxSwitchHelper.setPriceClasses( originalTaxDisplay );
}, 10 );
if ( settings && settings.data ) {
const methods = [
'get_variable_product_bulk_table', //Flycart Discount Rules for WooCommerce compatibility
];

const isMethodMatched = methods.some( ( method ) =>
settings.data.includes( method )
);

if ( isMethodMatched ) {
setTimeout( function () {
TaxSwitchHelper.setPriceClasses( originalTaxDisplay );
}, 10 );
}
}
} );

const thirdPartyEvents = [
'jet-engine/listing-grid/after-load-more', //JetEngine Listing Grid 'infinity scroll' compatibility
];

thirdPartyEvents.forEach( function ( eventName ) {
jQuery( document ).on( eventName, function ( event, response ) {
TaxSwitchHelper.setPriceClasses( originalTaxDisplay );
} );
} );
}
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wdevs-tax-switch",
"version": "1.1.9",
"version": "1.1.10",
"description": "Let customers toggle between inclusive and exclusive VAT pricing in your WooCommerce store.",
"author": "Wijnberg Developments",
"license": "GPL-2.0-or-later",
Expand Down
4 changes: 2 additions & 2 deletions wdevs-tax-switch.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Plugin Name: Tax Switch for WooCommerce
* Plugin URI: https://wijnberg.dev
* Description: Let customers toggle between inclusive and exclusive VAT pricing in your WooCommerce store.
* Version: 1.1.9
* Version: 1.1.10
* Author: Wijnberg Developments
* Author URI: https://wijnberg.dev/
* License: GPL-2.0+
Expand All @@ -41,7 +41,7 @@
* Start at version 1.0.0 and use SemVer - https://semver.org
* Rename this for your plugin and update it as you release new versions.
*/
define( 'WDEVS_TAX_SWITCH_VERSION', '1.1.9' );
define( 'WDEVS_TAX_SWITCH_VERSION', '1.1.10' );

/**
* The code that runs during plugin activation.
Expand Down

0 comments on commit 66b170f

Please sign in to comment.