Merge branch 'ticket-payboxAgreement' into develop
This commit is contained in:
commit
bd166ff884
@ -244,10 +244,17 @@ class Paybox extends PaymentModule
|
|||||||
|
|
||||||
// verif if there's at least one order with this delivery address
|
// verif if there's at least one order with this delivery address
|
||||||
$orders_with_delivery_address = Db::getInstance()->getValue('
|
$orders_with_delivery_address = Db::getInstance()->getValue('
|
||||||
SELECT COUNT(`id_order`)
|
SELECT COUNT(o.`id_order`)
|
||||||
FROM `'._DB_PREFIX_.'orders`
|
FROM `'._DB_PREFIX_.'orders` o
|
||||||
WHERE `id_address_delivery` = '.(int)$cart->id_address_delivery.'
|
WHERE o.`id_address_delivery` = '.(int)$cart->id_address_delivery.'
|
||||||
AND `id_customer` = '.(int)$cart->id_customer.'
|
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)
|
||||||
|
)
|
||||||
|
)
|
||||||
');
|
');
|
||||||
if ($orders_with_delivery_address == 0){
|
if ($orders_with_delivery_address == 0){
|
||||||
$paybox_cards = array();
|
$paybox_cards = array();
|
||||||
|
Loading…
Reference in New Issue
Block a user