Last active
November 11, 2019 06:22
-
-
Save amdrew/2192eb02839fcdf9e3d2 to your computer and use it in GitHub Desktop.
Easy Digital Downloads - Make sure only 1 download can exist in the cart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// A customer on the Easy Digital Downloads forums needed a way to limit their checkout cart to only 1 download at a time. | |
// The following filter will clear the cart right before a download is added via the purchase buttons, meaning only the most recently added download will exist in the cart. | |
// Copy and paste the following filter into your child theme's functions.php or custom plugin: | |
add_filter( 'edd_pre_add_to_cart_contents', '__return_false' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment