Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check all coupon that use the same code #1114

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

marcusds
Copy link
Contributor

Instead of just checking the first code and failing if it doesn't work, check all codes until we find the first that works.

Instead of just checking the first code and failing if it doesn't work,
check all codes until we find the first that works.
@JustinSainton JustinSainton added this to the Future Release milestone May 10, 2014
return false;
} else {

$coupons_data = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM `".WPSC_TABLE_COUPON_CODES."` WHERE coupon_code = %s", $code ) , ARRAY_A );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be spaced out a bit more:

$wpdb->prepare( 'SELECT * FROM ' . WPSC_TABLE_COUPON_CODES . ' WHERE coupon_code = %s', $code )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants