本文整理汇总了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);
}
示例2: onPaymentDisplay
function onPaymentDisplay(&$order, &$methods, &$usable_methods)
{
if (!$this->init()) {
return false;
}
return parent::onPaymentDisplay($order, $methods, $usable_methods);
}
示例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);
}
示例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);
}
示例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;
}