| @@ 502-529 (lines=28) @@ | ||
| 499 | * |
|
| 500 | * @return float Price. |
|
| 501 | */ |
|
| 502 | public function get_price() { |
|
| 503 | ||
| 504 | if ( ! isset( $this->price ) ) { |
|
| 505 | ||
| 506 | $this->price = give_maybe_sanitize_amount( |
|
| 507 | give_get_meta( |
|
| 508 | $this->ID, |
|
| 509 | '_give_set_price', |
|
| 510 | true |
|
| 511 | ) |
|
| 512 | ); |
|
| 513 | ||
| 514 | if ( ! $this->price ) { |
|
| 515 | $this->price = 0; |
|
| 516 | } |
|
| 517 | ||
| 518 | } |
|
| 519 | ||
| 520 | /** |
|
| 521 | * Override the donation form set price. |
|
| 522 | * |
|
| 523 | * @since 1.0 |
|
| 524 | * |
|
| 525 | * @param string $price The donation form price. |
|
| 526 | * @param string|int $id The form ID. |
|
| 527 | */ |
|
| 528 | return apply_filters( 'give_get_set_price', $this->price, $this->ID ); |
|
| 529 | } |
|
| 530 | ||
| 531 | /** |
|
| 532 | * Retrieve the minimum price. |
|
| @@ 567-578 (lines=12) @@ | ||
| 564 | * |
|
| 565 | * @return float Maximum price. |
|
| 566 | */ |
|
| 567 | public function get_maximum_price() { |
|
| 568 | ||
| 569 | if ( ! isset( $this->maximum_price ) ) { |
|
| 570 | $this->maximum_price = give_get_meta( $this->ID, '_give_custom_amount_range_maximum', true, 999999.99 ); |
|
| 571 | ||
| 572 | if ( ! $this->is_custom_price_mode() ) { |
|
| 573 | $this->maximum_price = give_get_highest_price_option( $this->ID ); |
|
| 574 | } |
|
| 575 | } |
|
| 576 | ||
| 577 | return apply_filters( 'give_get_set_maximum_price', $this->maximum_price, $this->ID ); |
|
| 578 | } |
|
| 579 | ||
| 580 | /** |
|
| 581 | * Retrieve the variable prices |
|
| @@ 805-819 (lines=15) @@ | ||
| 802 | * |
|
| 803 | * @return string Type of donation form, either 'set' or 'multi'. |
|
| 804 | */ |
|
| 805 | public function get_type() { |
|
| 806 | ||
| 807 | if ( ! isset( $this->type ) ) { |
|
| 808 | ||
| 809 | $this->type = give_get_meta( $this->ID, '_give_price_option', true ); |
|
| 810 | ||
| 811 | if ( empty( $this->type ) ) { |
|
| 812 | $this->type = 'set'; |
|
| 813 | } |
|
| 814 | ||
| 815 | } |
|
| 816 | ||
| 817 | return apply_filters( 'give_get_form_type', $this->type, $this->ID ); |
|
| 818 | ||
| 819 | } |
|
| 820 | ||
| 821 | /** |
|
| 822 | * Get form tag classes. |
|