Home / Admin / Limit Cart to One Item
Duplicate Snippet

Embed Snippet on Your Site

Limit Cart to One Item

Prevents customers from ever purchasing more than a single item at once

Code Preview
php
<?php
function pw_edd_one_item_checkout( $download_id, $options ) {
	if( edd_get_cart_quantity() >= 1 ) {
		edd_empty_cart();
	}
}
add_action( 'edd_pre_add_to_cart', 'pw_edd_one_item_checkout', 10, 2 );

Comments

Add a Comment