Donation Amount Not Reflected in Checkout Total

Some users have reported issues where they select a donation amount in the donation form and proceed to checkout (or the cart, if cart redirection is configured). However, the donation amount is not reflected in the cart or checkout total, even though the correct amount is selected in the donation form at the top of the page.

Likely Cause

This issue is most likely related to a nonce verification problem. Nonce verification helps secure your site by validating requests; however, when using caching plugins, the nonce verification can sometimes fail, preventing the product from being added to the cart during page load.

Solution

To address this issue, follow the steps outlined in the troubleshooting guide here: Resolving Error: Invalid Nonce.

By resolving the nonce verification issue, the donation amount should be correctly reflected in the cart and checkout totals.

Disable Nonce Verification for the Add to Cart Endpoint

If you continue to experience nonce-related issues, you can disable nonce verification by using the wcdp_skip_nonce_validation filter. Ensure that you have at least version 1.3.4 installed before applying this change. You can use the free Code Snippets plugin to add this custom code:

add_filter('wcdp_skip_nonce_validation', '__return_true');

⚠️ Note: Disable nonce verification for the Donation Platform for WooCommerce cart endpoint only if absolutely necessary, as it can impact your site’s security. However, the risk is generally low, as tricking users into adding items to their cart is typically considered a minor concern.