@@ 679-698 (lines=20) @@ | ||
676 | * |
|
677 | * @return bool |
|
678 | */ |
|
679 | public function is_single_price_mode() { |
|
680 | ||
681 | $option = give_get_meta( $this->ID, '_give_price_option', true ); |
|
682 | $ret = 0; |
|
683 | ||
684 | if ( empty( $option ) || $option === 'set' ) { |
|
685 | $ret = 1; |
|
686 | } |
|
687 | ||
688 | /** |
|
689 | * Override the price mode for a donation when checking if is in single price mode. |
|
690 | * |
|
691 | * @since 1.0 |
|
692 | * |
|
693 | * @param bool $ret Is donation form in single price mode? |
|
694 | * @param int|string $ID The ID of the donation form. |
|
695 | */ |
|
696 | return (bool) apply_filters( 'give_single_price_option_mode', $ret, $this->ID ); |
|
697 | ||
698 | } |
|
699 | ||
700 | /** |
|
701 | * Determine if custom price mode is enabled or disabled |
|
@@ 778-795 (lines=18) @@ | ||
775 | * |
|
776 | * @return bool |
|
777 | */ |
|
778 | public function has_variable_prices() { |
|
779 | ||
780 | $option = give_get_meta( $this->ID, '_give_price_option', true ); |
|
781 | $ret = 0; |
|
782 | ||
783 | if ( $option === 'multi' ) { |
|
784 | $ret = 1; |
|
785 | } |
|
786 | ||
787 | /** |
|
788 | * Filter: Override whether the donation form has variables prices. |
|
789 | * |
|
790 | * @param bool $ret Does donation form have variable prices? |
|
791 | * @param int|string $ID The ID of the donation form. |
|
792 | */ |
|
793 | return (bool) apply_filters( 'give_has_variable_prices', $ret, $this->ID ); |
|
794 | ||
795 | } |
|
796 | ||
797 | /** |
|
798 | * Retrieve the donation form type, set or multi-level |