當前位置: 首頁>>代碼示例>>PHP>>正文


PHP hikashopPaymentPlugin::onPaymentDisplay方法代碼示例

本文整理匯總了PHP中hikashopPaymentPlugin::onPaymentDisplay方法的典型用法代碼示例。如果您正苦於以下問題:PHP hikashopPaymentPlugin::onPaymentDisplay方法的具體用法?PHP hikashopPaymentPlugin::onPaymentDisplay怎麽用?PHP hikashopPaymentPlugin::onPaymentDisplay使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在hikashopPaymentPlugin的用法示例。


在下文中一共展示了hikashopPaymentPlugin::onPaymentDisplay方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: onPaymentDisplay

 function onPaymentDisplay(&$order, &$methods, &$usable_methods)
 {
     $user = JFactory::getUser();
     if (empty($user->id)) {
         return false;
     }
     $ordered_methods = array();
     foreach ($methods as &$method) {
         if ($method->payment_type != $this->name || !$method->enabled || !$method->payment_published) {
             continue;
         }
         if (!empty($method->payment_params->virtual_coupon)) {
             $ordered_methods[] =& $method;
         }
     }
     foreach ($methods as &$method) {
         if ($method->payment_type != $this->name || !$method->enabled || !$method->payment_published) {
             continue;
         }
         if (empty($method->payment_params->virtual_coupon)) {
             $ordered_methods[] =& $method;
         }
     }
     if (empty($ordered_methods)) {
         return;
     }
     $config =& hikashop_config();
     $this->main_currency = $config->get('main_currency', 1);
     $this->currency_id = hikashop_getCurrency();
     $this->points = $this->getUserPoints(null, 'all');
     $this->virtualpoints = $this->getVirtualPoints($order, 'all');
     $this->virtual_coupon_used = false;
     parent::onPaymentDisplay($order, $ordered_methods, $usable_methods);
 }
開發者ID:q0821,項目名稱:esportshop,代碼行數:34,代碼來源:userpoints.php

示例2: onPaymentDisplay

 function onPaymentDisplay(&$order, &$methods, &$usable_methods)
 {
     if (!$this->init()) {
         return false;
     }
     return parent::onPaymentDisplay($order, $methods, $usable_methods);
 }
開發者ID:rodhoff,項目名稱:MNW,代碼行數:7,代碼來源:stripe.php

示例3: onPaymentDisplay

 function onPaymentDisplay(&$order, &$methods, &$usable_methods)
 {
     if (!$this->isShippingValid(@$order->shipping)) {
         return true;
     }
     $this->user = hikashop_loadUser(true);
     return parent::onPaymentDisplay($order, $methods, $usable_methods);
 }
開發者ID:q0821,項目名稱:esportshop,代碼行數:8,代碼來源:bf_rbsbusinessgateway.php

示例4: onPaymentDisplay

 function onPaymentDisplay(&$order, &$methods, &$usable_methods)
 {
     if (empty($methods)) {
         return false;
     }
     switch (@$order->shipping->shipping_params->shipping_price_type) {
         case 'quote':
         case 'from':
             break;
         default:
             return false;
     }
     return parent::onPaymentDisplay($order, $methods, $usable_methods);
 }
開發者ID:brainforgeUK,項目名稱:plg_bf_quotation,代碼行數:14,代碼來源:bf_quotation.php

示例5: canDisplayButton

 function canDisplayButton(&$view, $type = 'checkout')
 {
     static $method = null;
     if (is_null($method)) {
         $class = hikashop_get('class.cart');
         $cart = $class->loadFullCart(true);
         $methods = $this->loadPaymentMethod('', 'all', $cart);
         if ($methods) {
             $already = array();
             $max = 0;
             foreach ($methods as $k => $method) {
                 if (!empty($method->payment_params)) {
                     $methods[$k]->payment_params = @unserialize($method->payment_params);
                 }
                 $methods[$k]->enabled = true;
                 if (empty($method->ordering)) {
                     $max++;
                     $methods[$k]->ordering = $max;
                 }
                 while (isset($already[$methods[$k]->ordering])) {
                     $max++;
                     $methods[$k]->ordering = $max;
                 }
                 $already[$methods[$k]->ordering] = true;
             }
             $usable_methods = array();
             parent::onPaymentDisplay($cart, $methods, $usable_methods);
             if (count($usable_methods)) {
                 $method = reset($usable_methods);
             }
         }
     }
     if (is_object($method) && empty($method->errors)) {
         if ($method->payment_params->displaycart && $type == 'cart') {
             return true;
         } elseif ($method->payment_params->displaycheckout && $type == 'checkout') {
             return true;
         }
     }
     return false;
 }
開發者ID:q0821,項目名稱:esportshop,代碼行數:41,代碼來源:paypalexpress.php


注:本文中的hikashopPaymentPlugin::onPaymentDisplay方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。