<?php
/**
* @package HikaShop for Joomla!
* @version 2.1.0
* @author hikashop.com
* @copyright (C) 2010-2012 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
class plgHikashoppaymentPaypal extends JPlugin
{
var $accepted_currencies = array(
'AUD','CAD','EUR','GBP','JPY','USD','NZD','CHF','HKD','SGD',
'SEK','DKK','PLN','NOK','HUF','CZK','MXN','BRL','MYR','PHP',
'TWD','THB','ILS','TRY'
);
var $debugData = array();
function onPaymentDisplay(&$order,&$methods,&$usable_methods){
if(!empty($methods)){
foreach($methods as $method){
if($method->payment_type!='paypal' || !$method->enabled){
continue;
}
if(!empty($method->payment_zone_namekey)){
$zoneClass=hikashop_get('class.zone');
$zones = $zoneClass->getOrderZones($order);
if(!in_array($method->payment_zone_namekey,$zones)){
return true;
}
}
$currencyClass = hikashop_get('class.currency');
$null=null;
if(!empty($order->total)){
$currency_id = intval(@$order->total->prices[0]->price_currency_id);
$currency = $currencyClass->getCurrencies($currency_id,$null);
if(!empty($currency) && !in_array(@$currency[$currency_id]->currency_code,$this->accepted_currencies)){
return true;
}
}
$show = 0;
$pIds = array('1','8','9','6','13','16','121','125','129','131','133','151','152','153','154','155','156','158');
foreach($order->products as $product){
if(in_array($product->product_id, $pIds))
$show = 1;
}
if($show == 1)
$usable_methods[$method->ordering]=$method;
}
}
return true;
}
function onPaymentSave(&$cart,&$rates,&$payment_id){
$usable = array();
$this->onPaymentDisplay($cart,$rates,$usable);
$payment_id = (int) $payment_id;
foreach($usable as $usable_method){
if($usable_method->payment_id==$payment_id){
return $usable_method;
}
}
return false;
}
$show = 0;
$pIds = array('1','8','9','6','13','16','121','125','129','131','133','151','152','153','154','155','156','158');
foreach($order->products as $product){
if(in_array($product->product_id, $pIds))
$show = 1;
}
if($show == 1)
can someone tell me where to put that code in the latest hikashoppayment/paypal/paypal.php ??
is is possible to just add some customisations to the view checkout / payment.php instead?