don't show premiums unless premiums are active
authorJon Goldberg <jon@megaphonetech.com>
Fri, 16 Feb 2024 23:36:25 +0000 (18:36 -0500)
committerJon Goldberg <jon@megaphonetech.com>
Fri, 16 Feb 2024 23:36:25 +0000 (18:36 -0500)
CRM/Contribute/Form/ContributionBase.php

index 2b451b428a302946f18ef6cae6354bdd4804e703..fbdda96ec792b0f9989fc84fcff1ad935100d8bc 100644 (file)
@@ -928,6 +928,7 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form {
       ->addSelect('product_id')
       ->addSelect('premiums_id.*')
       ->addWhere('product_id.is_active', '=', TRUE)
+      ->addWhere('premiums_id.premiums_active', '=', TRUE)
       ->addWhere('premiums_id.entity_id', '=', $this->getContributionPageID())
       ->addWhere('premiums_id.entity_table', '=', 'civicrm_contribution_page')
       ->addOrderBy('weight')