当前位置: 首页>>代码示例>>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;未经允许,请勿转载。