Skip to content

Commit

Permalink
CIVICRM-2137 Add closing div and force renewal javascript back to mak…
Browse files Browse the repository at this point in the history
…eContribution context for Membership block on Contributions
  • Loading branch information
agileware-fj committed May 24, 2023
1 parent f360d56 commit 1719a42
Showing 1 changed file with 24 additions and 27 deletions.
51 changes: 24 additions & 27 deletions templates/CRM/Contribute/Form/Contribution/MembershipBlock.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
| and copyright information, see https://civicrm.org/licensing |
+--------------------------------------------------------------------+
*}
{if $context EQ "makeContribution"}
<div id="membership" class="crm-group membership-group">

<div id="membership" class="crm-group membership-group">
{if $context EQ "makeContribution"}
<div id="priceset">
<fieldset>
{if $renewal_mode}
Expand Down Expand Up @@ -53,6 +52,27 @@
{include file="CRM/Price/Form/PriceSet.tpl" extends="Membership"}
</fieldset>
</div>
{literal}
<script type="text/javascript">
CRM.$(function($) {
//if price set is set we use below below code to show for showing auto renew
var autoRenewOption = {/literal}'{$autoRenewOption}'{literal};
var autoRenew = $("#auto_renew_section");
var autoRenewCheckbox = $("#auto_renew");
var forceRenew = $("#force_renew");
autoRenew.hide();
forceRenew.hide();
if ( autoRenewOption == 1 ) {
autoRenew.show();
} else if ( autoRenewOption == 2 ) {
autoRenewCheckbox.prop('checked', true );
autoRenewCheckbox.attr( 'readonly', true );
autoRenew.hide();
forceRenew.show();
}
});
</script>
{/literal}
{elseif $lineItem and $priceSetID AND !$is_quick_config}
{assign var="totalAmount" value=$amount}
<div class="header-dark">
Expand All @@ -61,29 +81,6 @@
<div class="display-block">
{include file="CRM/Price/Page/LineItem.tpl" context="Membership"}
</div>

</div>
{literal}
<script type="text/javascript">
CRM.$(function($) {
//if price set is set we use below below code to show for showing auto renew
var autoRenewOption = {/literal}'{$autoRenewOption}'{literal};
var autoRenew = $("#auto_renew_section");
var autoRenewCheckbox = $("#auto_renew");
var forceRenew = $("#force_renew");
autoRenew.hide();
forceRenew.hide();
if ( autoRenewOption == 1 ) {
autoRenew.show();
} else if ( autoRenewOption == 2 ) {
autoRenewCheckbox.prop('checked', true );
autoRenewCheckbox.attr( 'readonly', true );
autoRenew.hide();
forceRenew.show();
}
});
</script>
{/literal}
{elseif $membershipBlock AND !$is_quick_config}
<div id="membership" class="crm-group membership-group">
{if $context EQ "makeContribution"}
Expand Down Expand Up @@ -134,7 +131,7 @@
</div>

{/if}{* membership block end here *}

</div>
{if $membershipBlock AND $is_quick_config}
{if $context neq "makeContribution" }
<div class="header-dark">
Expand Down

0 comments on commit 1719a42

Please sign in to comment.