Fix for paypal button
authorSudha Bisht <sudha.bisht@webaccessglobal.com>
Fri, 5 Jun 2015 12:49:24 +0000 (18:19 +0530)
committerSudha Bisht <sudha.bisht@webaccessglobal.com>
Fri, 5 Jun 2015 12:54:31 +0000 (18:24 +0530)
CRM/Core/Payment/Form.php
templates/CRM/Core/BillingBlock.tpl

index 865fa196db96a5d52ba5aa0151d639012884957d..5e1a007c323dfc0909452516ccbb7b835d540c48 100644 (file)
@@ -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',
index 268fb97d3cd6d4c67adc55f711635fb8f6fb48ad..eaf6b908bcf327357e01f041c97f422c9f4fd91e 100644 (file)
 *}
 {crmRegion name="billing-block"}
 <div id="payment_information">
-  {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')}
     <fieldset class="billing_mode-group {$paymentTypeName}_info-group">
       <legend>
         {$paymentTypeLabel}
       </legend>
+      {if $form.$expressButtonName}
+        {include file= "CRM/Core/paypalexpress.tpl"}
+      {/if}
       <div class="crm-section billing_mode-section {$paymentTypeName}_info-section">
         {foreach from=$paymentFields item=paymentField}
           <div class="crm-section {$form.$paymentField.name}-section">