AntonLV 9 лет назад
Родитель
Сommit
960c8d13da

+ 4 - 5
modules/boonex/payment/classes/BxPaymentModule.php

@@ -113,11 +113,10 @@ class BxPaymentModule extends BxBaseModPaymentModule
     	$iSellerId = $this->getProfileId();
         $aItems = $this->callGetCartItems((int)$iModuleId, array($iSellerId));
 
-        $aResult = array('code' => 0);
-        if(is_array($aItems) && !empty($aItems))
-            $aResult['data'] = $this->_oTemplate->displayItems($sType, $aItems);
-
-		echoJson($aResult);
+		echoJson(array(
+			'code' => 0, 
+			'data' => $this->_oTemplate->displayItems($sType, $aItems)
+		));
     }
 
 

+ 20 - 19
modules/boonex/payment/classes/BxPaymentTemplate.php

@@ -302,25 +302,26 @@ class BxPaymentTemplate extends BxBaseModPaymentTemplate
     {
         $aTmplVarsItems = array();
 
-        foreach($aItems as $aItem) {
-            $aTmplVarsItems[$aItem['title']] = array(
-                'id' => $aItem['id'],
-                'price' => $this->_oConfig->getPrice($sType, $aItem),
-                'bx_if:link' => array(
-                    'condition' => !empty($aItem['url']),
-                    'content' => array(
-                        'url' => $aItem['url'],
-                        'title' => $aItem['title']
-                    )
-                ),
-                'bx_if:text' => array(
-                    'condition' => empty($aItem['url']),
-                    'content' => array(
-                        'title' => $aItem['title']
-                    )
-                ),
-            );
-        }
+        if(!empty($aItems) && is_array($aItems))
+            foreach($aItems as $aItem) {
+                $aTmplVarsItems[$aItem['title']] = array(
+                    'id' => $aItem['id'],
+                    'price' => $this->_oConfig->getPrice($sType, $aItem),
+                    'bx_if:link' => array(
+                        'condition' => !empty($aItem['url']),
+                        'content' => array(
+                            'url' => $aItem['url'],
+                            'title' => $aItem['title']
+                        )
+                    ),
+                    'bx_if:text' => array(
+                        'condition' => empty($aItem['url']),
+                        'content' => array(
+                            'title' => $aItem['title']
+                        )
+                    ),
+                );
+            }
 
         if(!empty($aTmplVarsItems) && is_array($aTmplVarsItems)) {
             ksort($aTmplVarsItems);