From c9c559fd8ac1ab82a2463944718db87125844d2c Mon Sep 17 00:00:00 2001 From: Sudha Bisht Date: Fri, 5 Jun 2015 18:19:24 +0530 Subject: [PATCH] Fix for paypal button --- CRM/Core/Payment/Form.php | 3 +-- templates/CRM/Core/BillingBlock.tpl | 9 ++++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/CRM/Core/Payment/Form.php b/CRM/Core/Payment/Form.php index 865fa196db..5e1a007c32 100644 --- a/CRM/Core/Payment/Form.php +++ b/CRM/Core/Payment/Form.php @@ -303,8 +303,7 @@ class CRM_Core_Payment_Form { */ protected static function addPaypalExpressCode(&$form) { if (empty($form->isBackOffice)) { - if (CRM_Utils_Array::value('billing_mode', $form->_paymentProcessor) == 3 - ) { + if (in_array(CRM_Utils_Array::value('billing_mode', $form->_paymentProcessor), array(2,3))) { $form->_expressButtonName = $form->getButtonName('upload', 'express'); $form->assign('expressButtonName', $form->_expressButtonName); $form->add('image', diff --git a/templates/CRM/Core/BillingBlock.tpl b/templates/CRM/Core/BillingBlock.tpl index 268fb97d3c..eaf6b908bc 100644 --- a/templates/CRM/Core/BillingBlock.tpl +++ b/templates/CRM/Core/BillingBlock.tpl @@ -25,15 +25,14 @@ *} {crmRegion name="billing-block"}
- {if $form.$expressButtonName} - {if $paymentProcessor.payment_processor_type NEQ 'PayPal_Express'} - {include file= "CRM/Core/paypalexpress.tpl"} - {/if} - {else $paymentFields|@count} + {if $paymentFields|@count && (!$form.$expressButtonName || $paymentProcessor.payment_processor_type EQ 'PayPal')}
{$paymentTypeLabel} + {if $form.$expressButtonName} + {include file= "CRM/Core/paypalexpress.tpl"} + {/if}
{foreach from=$paymentFields item=paymentField}
-- 2.25.1