<div id="billing-payment-block">
{* If we have a payment processor, load it - otherwise it happens via ajax *}
- {if $ppType}
+ {if $ppType or $isBillingAddressRequiredForPayLater}
{include file="CRM/Contribute/Form/Contribution/Main.tpl" snippet=4}
{/if}
</div>
CRM.$(function($) {
// highlight price sets
function updatePriceSetHighlight() {
- cj('#priceset .price-set-row').removeClass('highlight');
- cj('#priceset .price-set-row input:checked').parent().parent().addClass('highlight');
+ cj('#priceset .price-set-row span').removeClass('highlight');
+ cj('#priceset .price-set-row input:checked').parent().addClass('highlight');
}
cj('#priceset input[type="radio"]').change(updatePriceSetHighlight);
updatePriceSetHighlight();
+
+ function toggleBillingBlockIfFree(){
+ var total_amount_tmp = $(this).data('raw-total');
+ // Hide billing questions if this is free
+ if (total_amount_tmp == 0){
+ cj("#billing-payment-block").hide();
+ cj(".payment_options-group").hide();
+ }
+ else {
+ cj("#billing-payment-block").show();
+ cj(".payment_options-group").show();
+ }
+ }
+
+ $('#pricevalue').each(toggleBillingBlockIfFree).on('change', toggleBillingBlockIfFree);
});
{/literal}
</script>