-
Notifications
You must be signed in to change notification settings - Fork 475
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
Custom table for discount codes - Issue/5277 #6224
Conversation
🎉 @pippinsplugins there are a few method doc blocks in the meta class marking a method as private when it's defined as public. |
…better column names, and better defaults. #5277
6f785d3
to
6321505
Compare
@mindctrl Only change I haven't made is prefixing the input names with |
…gital-downloads into issue/5277
assets/js/admin-scripts.js
Outdated
@@ -874,7 +874,7 @@ jQuery(document).ready(function ($) { | |||
|
|||
product_requirements : function() { | |||
|
|||
$('#products').change(function() { | |||
$('#edd_products').change(function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ID uses an underscore here but the HTML elements class is set up with a hyphen at https://github.com/easydigitaldownloads/easy-digital-downloads/pull/6224/files#diff-2e1c495c5f0ae4bbbaddef446f7f44eeR88
includes/class-edd-db-discounts.php
Outdated
LIMIT %d,%d; | ||
", absint( $args['offset'] ), absint( $args['number'] ) ), 0 ); | ||
|
||
echo "SELECT id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This echo
shouldn't be here.
includes/class-edd-discount.php
Outdated
case 'post_mime_type' : | ||
case 'comment_count' : | ||
case 'filter' : | ||
case 'post_type' : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should return edd_discount
for post_type
to help ensure any custom integrations that check for the post type still function.
@@ -271,18 +335,65 @@ public function __set( $key, $value ) { | |||
|
|||
// Only real properties can be saved. | |||
$keys = array_keys( get_class_vars( get_called_class() ) ); | |||
$old_keys = array( | |||
'is_single_use', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is_single_use
is in the array twice.
'_edd_discount_name', | ||
'_edd_discount_code', | ||
'_edd_discount_expiration', | ||
'_edd_discount_start', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is missing a few keys: _edd_discount_is_single_use
, _edd_discount_is_not_global
, _edd_discount_product_condition
, _edd_discount_min_price,
_edd_discount_max_uses`.
Same thing at line 998.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And 1052.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And 1094
Migration to custom tables for discount codes.
#5277