Skip to content

Commit

Permalink
fix: fee recovery checkbox not being applied
Browse files Browse the repository at this point in the history
Update wcdp.js, wcdp.min.js, and 2 more files...
  • Loading branch information
jonas-hoebenreich committed Nov 28, 2024
1 parent 56fddd4 commit 35f3b00
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
19 changes: 10 additions & 9 deletions assets/js/wcdp.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
jQuery( function( $ ) {
$(document).on('change', '#wcdp_fee_recovery, input[name="payment_method"]', function () {
console.log('triggerCheckoutUpdate');
if ($(this).is('#wcdp_fee_recovery') || $('#wcdp_fee_recovery').prop('checked')) {
triggerCheckoutUpdate();
}
});

if (!document.querySelector('#wcdp')) return;

let currentFormData;
Expand Down Expand Up @@ -76,7 +83,7 @@ jQuery( function( $ ) {
/**
* Handle submit of add to cart form
*/
$('#wcdp-ajax-send').on('submit', function(e){
$('#wcdp-ajax-send')?.on('submit', function(e){
e.preventDefault();
const serialized = $("#wcdp-ajax-send").serialize();
if (currentFormData != serialized) {
Expand All @@ -91,7 +98,7 @@ jQuery( function( $ ) {
* Submit step 1 form automatically for style 3
*/
let time = 0;
$( '.wcdp-body > #wcdp-ajax-send' ).on('input blur keyup paste change', function (){
$( '.wcdp-body > #wcdp-ajax-send' )?.on('input blur keyup paste change', function (){
if (currentFormData != $("#wcdp-ajax-send").serialize()) {
time++;
currentFormData = $("#wcdp-ajax-send").serialize();
Expand All @@ -109,7 +116,7 @@ jQuery( function( $ ) {
*/
let expresstime = 0;
let currentprice = 0;
$( '.wcdp-body' ).on('input blur keyup paste change load', function (){
$( '.wcdp-body' )?.on('input blur keyup paste change load', function (){
const button = document.querySelector('.wcdp-body .single_add_to_cart_button');
const form = document.querySelector('#wcdp-get-send');
if (button && form && form.checkValidity()) {
Expand Down Expand Up @@ -270,12 +277,6 @@ jQuery( function( $ ) {
setTimeout(() => $('body').trigger('update_checkout'), delay);
}

$(document).on('change', '#wcdp_fee_recovery, input[name="payment_method"]', function () {
if ($(this).is('#wcdp_fee_recovery') || $('#wcdp_fee_recovery').prop('checked')) {
triggerCheckoutUpdate();
}
});

//copy value of range slider
$( '#wcdp-range' )?.on('input', function () {
const range = $( '#wcdp-range' );
Expand Down
2 changes: 1 addition & 1 deletion assets/js/wcdp.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: donation, fundraising, charity, woocommerce donation, recurring donation
Donate link: https://www.wc-donation.com/documentation/support/contact/
Requires at least: 5.8
Tested up to: 6.7
Stable tag: 1.3.3
Stable tag: 1.3.4
Requires PHP: 7.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -165,7 +165,10 @@ If you want to disable the wording changes applied by Donation Platform for WooC
== Changelog ==
Active development of Donation Platform for WooCommerce: Fundraising & Donation Management is handled [on GitHub](https://github.com/wc-donation/wc-donation-platform/).

= 1.3.3 =
= 1.3.4 =
fix: fee recovery checkbox not being applied

= 1.3.3 2024-11-17 =
feat: add style 9 to progress bar shortcode (just amount raised)
feat: option to redirect to cart instead of checkout
feat: add fallback attribute to Leaderboard Shortcode
Expand Down
2 changes: 1 addition & 1 deletion wc-donation-platform.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

define('WCDP_DIR', dirname(__FILE__) . '/');
define('WCDP_DIR_URL', plugin_dir_url(__FILE__));
const WCDP_VERSION = '1.3.3';
const WCDP_VERSION = '1.3.4';

/**
* Check if WooCommerce is active
Expand Down

0 comments on commit 35f3b00

Please sign in to comment.