From: monishdeb Date: Tue, 2 Sep 2014 07:39:09 +0000 (+0530) Subject: CRM-15103 fix - Priceset for memberships on contribution-page not working X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=79c045777605663809d516ddbd02be6c0f75ead5;p=civicrm-core.git CRM-15103 fix - Priceset for memberships on contribution-page not working https://issues.civicrm.org/jira/browse/CRM-15103 --- diff --git a/CRM/Contribute/Form/Contribution/Main.php b/CRM/Contribute/Form/Contribution/Main.php index c6a13d2074..3c2ee8fecd 100644 --- a/CRM/Contribute/Form/Contribution/Main.php +++ b/CRM/Contribute/Form/Contribution/Main.php @@ -842,7 +842,11 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu $priceFieldIDS[] = $fields['price_' . $priceId]; } - if (CRM_Utils_Array::value('options', $value)) { + if (CRM_Utils_Array::value('options', $value) && ( + ($fields['price_' . $priceId] == $val['id']) || + (isset($fields['price_' . $priceId]) && !empty($fields['price_' . $priceId][$val['id']])) + ) + ) { foreach ($value['options'] as $val) { if (CRM_Utils_Array::value('membership_type_id', $val)) { $priceFieldMemTypes[] = $val['membership_type_id']; diff --git a/CRM/Price/Page/Field.php b/CRM/Price/Page/Field.php index 9c0f6aa4f5..dae7188aae 100644 --- a/CRM/Price/Page/Field.php +++ b/CRM/Price/Page/Field.php @@ -170,7 +170,7 @@ class CRM_Price_Page_Field extends CRM_Core_Page { // need to translate html types from the db $htmlTypes = CRM_Price_BAO_PriceField::htmlTypes(); - $priceField[$priceFieldBAO->id]['html_type'] = $htmlTypes[$priceField[$priceFieldBAO->id]['html_type']]; + $priceField[$priceFieldBAO->id]['html_type_display'] = $htmlTypes[$priceField[$priceFieldBAO->id]['html_type']]; $priceField[$priceFieldBAO->id]['order'] = $priceField[$priceFieldBAO->id]['weight']; $priceField[$priceFieldBAO->id]['action'] = CRM_Core_Action::formLink(self::actionLinks(), $action, array( diff --git a/templates/CRM/Price/Page/Field.tpl b/templates/CRM/Price/Page/Field.tpl index e84f34e9e1..d5ec72cefa 100644 --- a/templates/CRM/Price/Page/Field.tpl +++ b/templates/CRM/Price/Page/Field.tpl @@ -75,13 +75,13 @@ {foreach from=$priceField key=fid item=row} {$row.label} - {$row.html_type} + {$row.html_type_display} {$row.order} {if $row.is_required eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if} {if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if} {if $row.active_on}{$row.active_on|date_format:"%Y-%m-%d %T"}{/if} {if $row.expire_on}{$row.expire_on|date_format:"%Y-%m-%d %T"}{/if} - {if $row.html_type eq "Text / Numeric Quantity"}{$row.price|crmMoney}{else}{if $isReserved}{ts}View Price Options{/ts}{else}{ts}Edit Price Options{/ts}{/if}{/if} + {if $row.html_type eq "Text"}{$row.price|crmMoney}{else}{if $isReserved}{ts}View Price Options{/ts}{else}{ts}Edit Price Options{/ts}{/if}{/if} {$row.action|replace:'xx':$row.id} {$row.weight}