Compare commits

...

2 Commits

Author SHA1 Message Date
Marion Muszynski
1e7243c023 checking orders addition 2016-09-09 17:19:12 +02:00
Marion Muszynski
e9ea05d32b addition of delivery address checking 2016-09-08 18:08:21 +02:00

View File

@ -542,8 +542,20 @@ class PayPal extends PaymentModule
elseif ($method == WPS || $method == ECS)
{
$cart = $this->context->cart;
$this->context->smarty->assign('accounts', $this->getBillingAgreement($cart->id_customer));
$orders_with_delivery_address = Db::getInstance()->getValue('
SELECT COUNT(`o.id_order`)
FROM `'._DB_PREFIX_.'orders` o
WHERE o.`id_address_delivery` = '.(int)$cart->id_address_delivery.'
AND o.`id_customer` = '.(int)$cart->id_customer.'
AND (
o.valid = 1
OR (
o.valid = 0
AND (SELECT h.id_order_state FROM `'._DB_PREFIX_.'order_history` h WHERE h.id_order = o.id_order ORDER BY h.date_add DESC LIMIT 1) NOT IN (6,8,15,16,18)
)
)
');
$this->context->smarty->assign('accounts', (($orders_with_delivery_address==0)?array():$this->getBillingAgreement($cart->id_customer)));
$this->getTranslations();
$this->context->smarty->assign(array(
'custom' => Tools::jsonEncode(array('id_cart' => $cart->id, 'hash' => sha1(serialize($cart->nbProducts())))),