本文整理匯總了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;
}