AntonLV пре 5 година
родитељ
комит
894e2aeb2c

+ 6 - 1
modules/boonex/payment/classes/BxPaymentTemplate.php

@@ -408,10 +408,15 @@ class BxPaymentTemplate extends BxBaseModPaymentTemplate
         foreach($aProviders as $sProvider => $aProvider) {
             list($sJsCode, $sJsOnclick) = $oModule->getProviderButtonJs($aCartItem, $aProvider, $sRedirect, $aCustom);
 
+            $sCaptionKey = '_bx_payment_txt_subscribe_' . $aProvider['name'];
+            $sCaptionValue = _t($sCaptionKey);
+            if(strcmp($sCaptionKey, $sCaptionValue) == 0)
+                $sCaptionValue = _t($aProvider['caption']);
+
             $aTmplVarsProviders[] = array(
                 'button' => $this->parseHtmlByName('providers_select_button.html', array(
                     'onclick' => $sJsOnclick,
-                    'title' => _t('_bx_payment_txt_checkout_with', _t($aProvider['caption'])),
+                    'title' => _t('_bx_payment_txt_checkout_with', $sCaptionValue),
                     'js_code' => $sJsCode
                 ))
             );

+ 8 - 3
modules/boonex/payment/js/cart.js

@@ -64,11 +64,11 @@ BxPaymentCart.prototype.onCartCheckout = function(oData) {
     location.href = oData.link;
 };
 
-BxPaymentCart.prototype.subscribe = function(iSellerId, sSellerProvider, iModuleId, iItemId, iItemCount, sRedirect, sCustom) {
-    this.subscribeWithAddons(iSellerId, sSellerProvider, iModuleId, iItemId, iItemCount, '', sRedirect, sCustom);
+BxPaymentCart.prototype.subscribe = function(oLink, iSellerId, sSellerProvider, iModuleId, iItemId, iItemCount, sRedirect, sCustom) {
+    this.subscribeWithAddons(oLink, iSellerId, sSellerProvider, iModuleId, iItemId, iItemCount, '', sRedirect, sCustom);
 };
 
-BxPaymentCart.prototype.subscribeWithAddons = function(iSellerId, sSellerProvider, iModuleId, iItemId, iItemCount, sItemAddons, sRedirect, sCustom) {
+BxPaymentCart.prototype.subscribeWithAddons = function(oLink, iSellerId, sSellerProvider, iModuleId, iItemId, iItemCount, sItemAddons, sRedirect, sCustom) {
     var $this = this;
     var oDate = new Date();
 
@@ -87,10 +87,15 @@ BxPaymentCart.prototype.subscribeWithAddons = function(iSellerId, sSellerProvide
     if(iItemCount != undefined && iItemCount.length > 0)
     	oParams.item_count = parseInt(iItemCount);
 
+    var oLoading = $(oLink).hasClass('bx-btn') ? oLink : null;
+    this.loadingInButton(oLoading, true);
+    
     $.post(
         this._sActionsUrl + 'subscribe_json/',
         oParams,
         function(oData){
+            $this.loadingInButton(oLoading, false);
+
             processJsonData(oData);
         },
         'json'

+ 1 - 1
modules/boonex/payment/template/subscribe.html

@@ -1,4 +1,4 @@
-<button class="bx-btn bx-btn-img bx-payment-subscribe bx-def-margin-sec-left-auto" onclick="javascript:__js_object__.subscribe(__vendor_id__, '__vendor_provider__', __module_id__, __item_id__, __item_count__, '__redirect__', '__custom__')">
+<button class="bx-btn bx-btn-img bx-payment-subscribe bx-def-margin-sec-left-auto" onclick="javascript:__js_object__.subscribe(this, __vendor_id__, '__vendor_provider__', __module_id__, __item_id__, __item_count__, '__redirect__', '__custom__')">
     <i class="sys-icon credit-card"></i>__txt_subscribe__
 </button>
 __js_content__

+ 1 - 1
modules/boonex/payment/template/subscribe_js.html

@@ -1 +1 @@
-__js_object__.subscribe(__vendor_id__, '__vendor_provider__', __module_id__, __item_id__, __item_count__, '__redirect__', '__custom__')
+__js_object__.subscribe(this, __vendor_id__, '__vendor_provider__', __module_id__, __item_id__, __item_count__, '__redirect__', '__custom__')