Easy Digital Downloads Purchase Link not working
-
I am using Easy Digital Downloads plugin to sell some digital products. However, I am facing an issue when I use the Purchase Link on ajax. If I use ajax filter and filter the products then the Purchase Link throws an error:
Uncaught TypeError: Cannot read property 'total' of null at Object.success (edd-ajax.js?ver=2.9.16:229) at i (jquery.js?ver=1.12.4-wp:2) at Object.fireWith [as resolveWith] (jquery.js?ver=1.12.4-wp:2) at x (jquery.js?ver=1.12.4-wp:4) at XMLHttpRequest.c (jquery.js?ver=1.12.4-wp:4)
However, the Purchase Link works fine on page load but is throwing the above error after I filter the products.
I know why I am facing this issue. Actually, there is a nonce value when I inspect the purchase button but when I try to alert or console it, the value is returned blank and hence nonce check fails. This leads to the above error – https://prntscr.com/qcvbm8
This is the code for purchase link –
echo edd_get_purchase_link( array( 'download_id' => 1111 ) );
Any help would be more than appreciable.
- The topic ‘Easy Digital Downloads Purchase Link not working’ is closed to new replies.