Skip to content

Commit

Permalink
Merge pull request #46 from dparker1005/fix-numeric-codes
Browse files Browse the repository at this point in the history
Fix numeric discount codes not applying subscription delay
  • Loading branch information
dparker1005 authored Feb 5, 2025
2 parents 13d30f1 + 10ecc0b commit b838049
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pmpro-subscription-delays.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ function pmprosd_pmpro_profile_start_date( $start_date, $order ) {
} elseif( pmpro_is_checkout() && ! empty( $order->getMembershipLevelAtCheckout()->discount_code ) ) {
// We are at checekout and the discount code use has not been added to the order yet.
$discount_code = $order->getMembershipLevelAtCheckout()->discount_code;
$code_obj = new PMPro_Discount_Code( $discount_code );
$code_obj = new PMPro_Discount_Code();
$code_obj->get_discount_code_by_code( $discount_code );
if ( ! empty( $code_obj->id ) ) {
$delays = pmpro_getDCSDs( $code_obj->id );
if ( ! empty( $delays[ $order->membership_id ] ) ) {
Expand Down

0 comments on commit b838049

Please sign in to comment.