| @@ 665-684 (lines=20) @@ | ||
| 662 | * |
|
| 663 | * @return bool |
|
| 664 | */ |
|
| 665 | public function is_single_price_mode() { |
|
| 666 | ||
| 667 | $option = give_get_meta( $this->ID, '_give_price_option', true ); |
|
| 668 | $ret = 0; |
|
| 669 | ||
| 670 | if ( empty( $option ) || $option === 'set' ) { |
|
| 671 | $ret = 1; |
|
| 672 | } |
|
| 673 | ||
| 674 | /** |
|
| 675 | * Override the price mode for a donation when checking if is in single price mode. |
|
| 676 | * |
|
| 677 | * @since 1.0 |
|
| 678 | * |
|
| 679 | * @param bool $ret Is donation form in single price mode? |
|
| 680 | * @param int|string $ID The ID of the donation form. |
|
| 681 | */ |
|
| 682 | return (bool) apply_filters( 'give_single_price_option_mode', $ret, $this->ID ); |
|
| 683 | ||
| 684 | } |
|
| 685 | ||
| 686 | /** |
|
| 687 | * Determine if custom price mode is enabled or disabled |
|
| @@ 764-781 (lines=18) @@ | ||
| 761 | * |
|
| 762 | * @return bool |
|
| 763 | */ |
|
| 764 | public function has_variable_prices() { |
|
| 765 | ||
| 766 | $option = give_get_meta( $this->ID, '_give_price_option', true ); |
|
| 767 | $ret = 0; |
|
| 768 | ||
| 769 | if ( $option === 'multi' ) { |
|
| 770 | $ret = 1; |
|
| 771 | } |
|
| 772 | ||
| 773 | /** |
|
| 774 | * Filter: Override whether the donation form has variables prices. |
|
| 775 | * |
|
| 776 | * @param bool $ret Does donation form have variable prices? |
|
| 777 | * @param int|string $ID The ID of the donation form. |
|
| 778 | */ |
|
| 779 | return (bool) apply_filters( 'give_has_variable_prices', $ret, $this->ID ); |
|
| 780 | ||
| 781 | } |
|
| 782 | ||
| 783 | /** |
|
| 784 | * Retrieve the donation form type, set or multi-level |
|