|
@@ 448-460 (lines=13) @@
|
| 445 |
|
if ( $discount ) { |
| 446 |
|
$start_date = wpinv_get_discount_start_date( $code_id ); |
| 447 |
|
|
| 448 |
|
if ( $start_date ) { |
| 449 |
|
$start_date = strtotime( $start_date ); |
| 450 |
|
|
| 451 |
|
if ( $start_date < current_time( 'timestamp' ) ) { |
| 452 |
|
// Discount has past the start date |
| 453 |
|
$return = true; |
| 454 |
|
} else { |
| 455 |
|
wpinv_set_error( 'wpinv-discount-error', __( 'This discount is not active yet.', 'invoicing' ) ); |
| 456 |
|
} |
| 457 |
|
} else { |
| 458 |
|
// No start date for this discount, so has to be true |
| 459 |
|
$return = true; |
| 460 |
|
} |
| 461 |
|
} |
| 462 |
|
|
| 463 |
|
return apply_filters( 'wpinv_is_discount_started', $return, $code_id ); |
|
@@ 473-485 (lines=13) @@
|
| 470 |
|
if ( $discount ) { |
| 471 |
|
$start_date = wpinv_get_discount_start_date( $code_id ); |
| 472 |
|
|
| 473 |
|
if ( $start_date ) { |
| 474 |
|
$start_date = strtotime( $start_date ); |
| 475 |
|
|
| 476 |
|
if ( $start_date < current_time( 'timestamp' ) ) { |
| 477 |
|
// Discount has past the start date |
| 478 |
|
$return = true; |
| 479 |
|
} else { |
| 480 |
|
wpinv_set_error( 'wpinv-discount-error', __( 'This discount is not active yet.', 'invoicing' ) ); |
| 481 |
|
} |
| 482 |
|
} else { |
| 483 |
|
// No start date for this discount, so has to be true |
| 484 |
|
$return = true; |
| 485 |
|
} |
| 486 |
|
|
| 487 |
|
if ( $return ) { |
| 488 |
|
$expiration = wpinv_get_discount_expiration( $code_id ); |