Completed
Push — master ( 9d3fbd...af269e )
by Michael
09:48
created

class/oledrion_commands.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/*
3
 You may not change or alter any portion of this comment or credits
4
 of supporting developers from this source code or any supporting source code
5
 which is considered copyrighted (c) material of the original comment or credit authors.
6
7
 This program is distributed in the hope that it will be useful,
8
 but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
*/
11
12
/**
13
 * oledrion
14
 *
15
 * @copyright   {@link https://xoops.org/ XOOPS Project}
16
 * @license     {@link http://www.fsf.org/copyleft/gpl.html GNU public license}
17
 * @author      Hervé Thouzard (http://www.herve-thouzard.com/)
18
 */
19
20
/**
21
 * Gestion des commandes clients
22
 */
23
require_once __DIR__ . '/classheader.php';
24
25
define('OLEDRION_STATE_NOINFORMATION', 0); // Pas encore d'informations sur la commande
26
define('OLEDRION_STATE_VALIDATED', 1); // Commande validée par la passerelle de paiement
27
define('OLEDRION_STATE_PENDING', 2); // En attente
28
define('OLEDRION_STATE_FAILED', 3); // Echec
29
define('OLEDRION_STATE_CANCELED', 4); // Annulée
30
define('OLEDRION_STATE_FRAUD', 5); // Fraude
31
define('OLEDRION_STATE_PACKED', 6);
32
define('OLEDRION_STATE_SUBMITED', 7);
33
define('OLEDRION_STATE_DELIVERYED', 8);
34
35
/**
36
 * Class Oledrion_commands
37
 */
38
class Oledrion_commands extends Oledrion_Object
39
{
40
    /**
41
     * constructor
42
     *
43
     * normally, this is called from child classes only
44
     *
45
     * @access public
46
     */
47
    public function __construct()
48
    {
49
        $this->initVar('cmd_id', XOBJ_DTYPE_INT, null, false);
50
        $this->initVar('cmd_uid', XOBJ_DTYPE_INT, null, false);
51
        $this->initVar('cmd_date', XOBJ_DTYPE_TXTBOX, null, false);
52
        $this->initVar('cmd_create', XOBJ_DTYPE_INT, null, false);
53
        $this->initVar('cmd_state', XOBJ_DTYPE_INT, null, false);
54
        $this->initVar('cmd_ip', XOBJ_DTYPE_TXTBOX, null, false);
55
        $this->initVar('cmd_lastname', XOBJ_DTYPE_TXTBOX, null, false);
56
        $this->initVar('cmd_firstname', XOBJ_DTYPE_TXTBOX, null, false);
57
        $this->initVar('cmd_adress', XOBJ_DTYPE_TXTAREA, null, false);
58
        $this->initVar('cmd_zip', XOBJ_DTYPE_TXTBOX, null, false);
59
        $this->initVar('cmd_town', XOBJ_DTYPE_TXTBOX, null, false);
60
        $this->initVar('cmd_country', XOBJ_DTYPE_TXTBOX, null, false);
61
        $this->initVar('cmd_telephone', XOBJ_DTYPE_TXTBOX, null, false);
62
        $this->initVar('cmd_mobile', XOBJ_DTYPE_TXTBOX, null, false);
63
        $this->initVar('cmd_email', XOBJ_DTYPE_TXTBOX, null, false);
64
        $this->initVar('cmd_articles_count', XOBJ_DTYPE_INT, null, false);
65
        $this->initVar('cmd_total', XOBJ_DTYPE_TXTBOX, null, false);
66
        $this->initVar('cmd_shipping', XOBJ_DTYPE_TXTBOX, null, false);
67
        $this->initVar('cmd_packing_price', XOBJ_DTYPE_TXTBOX, null, false);
68
        $this->initVar('cmd_bill', XOBJ_DTYPE_INT, null, false);
69
        $this->initVar('cmd_password', XOBJ_DTYPE_TXTBOX, null, false);
70
        $this->initVar('cmd_text', XOBJ_DTYPE_TXTAREA, null, false);
71
        $this->initVar('cmd_cancel', XOBJ_DTYPE_TXTBOX, null, false);
72
        $this->initVar('cmd_comment', XOBJ_DTYPE_TXTAREA, null, false);
73
        $this->initVar('cmd_vat_number', XOBJ_DTYPE_TXTAREA, null, false);
74
        $this->initVar('cmd_packing', XOBJ_DTYPE_TXTBOX, null, false);
75
        $this->initVar('cmd_packing_id', XOBJ_DTYPE_INT, null, false);
76
        $this->initVar('cmd_location', XOBJ_DTYPE_TXTBOX, null, false);
77
        $this->initVar('cmd_location_id', XOBJ_DTYPE_INT, null, false);
78
        $this->initVar('cmd_delivery', XOBJ_DTYPE_TXTBOX, null, false);
79
        $this->initVar('cmd_delivery_id', XOBJ_DTYPE_INT, null, false);
80
        $this->initVar('cmd_payment', XOBJ_DTYPE_TXTBOX, null, false);
81
        $this->initVar('cmd_payment_id', XOBJ_DTYPE_INT, null, false);
82
        $this->initVar('cmd_status', XOBJ_DTYPE_INT, null, false);
83
        $this->initVar('cmd_track', XOBJ_DTYPE_TXTBOX, null, false);
84
        $this->initVar('cmd_gift', XOBJ_DTYPE_TXTBOX, null, false);
85
    }
86
87
    /**
88
     * Retourne les éléments du produits formatés pour affichage
89
     *
90
     * @param  string $format Le format à utiliser
91
     * @return array  Les informations formatées
92
     */
93
    public function toArray($format = 's')
94
    {
95
        $ret = array();
96
        $ret = parent::toArray($format);
97
        require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
98
        $countries                           = array();
99
        $countries                           = XoopsLists::getCountryList();
100
        $oledrion_Currency                   = Oledrion_Currency::getInstance();
101
        $ret['cmd_total_fordisplay']         = $oledrion_Currency->amountForDisplay($this->getVar('cmd_total')); // Montant TTC de la commande
102
        $ret['cmd_shipping_fordisplay']      = $oledrion_Currency->amountForDisplay($this->getVar('cmd_shipping')); // Montant TTC des frais de port
103
        $ret['cmd_packing_price_fordisplay'] = $oledrion_Currency->amountForDisplay($this->getVar('cmd_packing_price'));
104
        $ret['cmd_text_fordisplay']          = nl2br($this->getVar('cmd_text')); // Liste des réductions accordées
105
        if (isset($countries[$this->getVar('cmd_country')])) { // Libellé du pays de l'acheteur
106
            $ret['cmd_country_label'] = $countries[$this->getVar('cmd_country')];
107
        }
108
        if ($this->getVar('cmd_uid') > 0) {
109
            $ret['cmd_uname'] = XoopsUser::getUnameFromId($this->getVar('cmd_uid'));
110
        }
111
        $ret['cmd_create_date'] = formatTimestamp($this->getVar('cmd_create'), _MEDIUMDATESTRING);
112
113
        return $ret;
114
    }
115
}
116
117
/**
118
 * Class OledrionOledrion_commandsHandler
119
 */
120
class OledrionOledrion_commandsHandler extends Oledrion_XoopsPersistableObjectHandler
121
{
122
    /**
123
     * OledrionOledrion_commandsHandler constructor.
124
     * @param XoopsDatabase|null $db
125
     */
126
    public function __construct(XoopsDatabase $db)
127
    { //                        Table                   Classe           Id
128
        parent::__construct($db, 'oledrion_commands', 'oledrion_commands', 'cmd_id');
129
    }
130
131
    /**
132
     * Indique si c'est la première commande d'un client
133
     *
134
     * @param  integer $uid Identifiant de l'utilisateur
135
     * @return boolean Indique si c'est le cas ou pas
136
     */
137
    public function isFirstCommand($uid = 0)
138
    {
139
        if ($uid == 0) {
140
            $uid = OledrionUtility::getCurrentUserID();
141
        }
142
        $critere = new Criteria('cmd_uid', (int)$uid, '=');
143
        if ($this->getCount($critere) > 0) {
144
            return true;
145
        } else {
146
            return false;
147
        }
148
    }
149
150
    /**
151
     * Indique si un produit a déajà été acheté par un utilisateur
152
     *
153
     * @param  integer $uid       Identifiant de l'utilisateur
154
     * @param  integer $productId Identifiant du produit
155
     * @return boolean Indique si c'est le cas ou pas
156
     */
157
    public function productAlreadyBought($uid = 0, $productId = 0)
158
    {
159
        if ($uid == 0) {
160
            $uid = OledrionUtility::getCurrentUserID();
161
        }
162
        $sql    = 'SELECT Count(*) AS cpt FROM ' . $this->db->prefix('oledrion_caddy') . ' c, ' . $this->db->prefix('oledrion_commands') . ' f WHERE c.caddy_product_id = ' . (int)$productId . ' AND c.caddy_cmd_id = f.cmd_id AND f.cmd_uid = ' . (int)$uid;
163
        $result = $this->db->query($sql);
164
        if (!$result) {
165
            return 0;
166
        }
167
        list($count) = $this->db->fetchRow($result);
168
        if ($count > 0) {
169
            return true;
170
        } else {
171
            return false;
172
        }
173
    }
174
175
    /**
176
     * Mise à jour des stocks pour chaque produit composant la commande
177
     *
178
     * @param  object $order La commande à traiter
179
     * @return void
180
     */
181
    public function updateStocks($order)
182
    {
183
        global $h_oledrion_caddy, $h_oledrion_products, $h_oledrion_persistent_cart;
184
        $orderId = $order->getVar('cmd_id');
185
        // Recherche de tous les produits du caddy
186
        $caddy  = $h_oledrion_caddy->getCaddyFromCommand($orderId);
187
        $tblTmp = $tblProducts = array();
188
        foreach ($caddy as $item) {
189
            $tblTmp[] = $item->getVar('caddy_product_id');
190
        }
191
        // Chargement de tous les produits
192
        $critere     = new Criteria('product_id', '(' . implode(',', $tblTmp) . ')', 'IN');
193
        $tblProducts = $h_oledrion_products->getObjects($critere, true);
194
        // Boucle sur le caddy pour mettre à jour les quantités
195
        foreach ($caddy as $item) {
196
            if (isset($tblProducts[$item->getVar('caddy_product_id')])) {
197
                $product = $tblProducts[$item->getVar('caddy_product_id')];
198
                $h_oledrion_products->decreaseStock($product, $item->getVar('caddy_qte'));
199
                $h_oledrion_products->verifyLowStock($product); // Vérification du stock d'alerte
200
                $h_oledrion_persistent_cart->deleteUserProduct($item->getVar('caddy_product_id'), $order->getVar('cmd_uid'));
201
            }
202
        }
203
204
        return true;
205
    }
206
207
    /**
208
     * Retourne la liste des URLs de téléchargement liés à une commande
209
     *
210
     * @param  object|Oledrion_commands $order La commande en question
211
     * @return array                    Les URL
212
     */
213
    public function getOrderUrls(Oledrion_commands $order)
214
    {
215
        global $h_oledrion_caddy, $h_oledrion_products;
216
        $retval = array();
217
        // Recherche des produits du caddy associés à cette commande
218
        $carts = $productsList = $products = array();
219
        $carts = $h_oledrion_caddy->getObjects(new Criteria('caddy_cmd_id', $order->getVar('cmd_id'), '='));
220
        foreach ($carts as $item) {
221
            $productsList[] = $item->getVar('caddy_product_id');
222
        }
223
        if (count($productsList) > 0) {
224
            $products = $h_oledrion_products->getObjects(new Criteria('product_id', '(' . implode(',', $productsList) . ')', 'IN'), true);
225
            if (count($products) > 0) {
226
                foreach ($carts as $item) {
227
                    $produit = null;
228
                    if (isset($products[$item->getVar('caddy_product_id')])) {
229
                        $produit = $products[$item->getVar('caddy_product_id')];
230
                        if (xoops_trim($produit->getVar('product_download_url')) != '') {
231
                            $retval[] = OLEDRION_URL . 'download.php?download_id=' . $item->getVar('caddy_pass');
232
                        }
233
                    }
234
                }
235
            }
236
        }
237
238
        return $retval;
239
    }
240
241
    /**
242
     * Envoi du mail chargé de prévenir le client et le magasin qu'une commande est validée
243
     *
244
     * @param object|Oledrion_commands $order   La commande en question
245
     * @param string                   $comment Optionel, un commentaire pour le webmaster
246
     */
247
    public function notifyOrderValidated(Oledrion_commands $order, $comment = '')
248
    {
249
        global $xoopsConfig;
250
        $msg                       = array();
251
        $Urls                      = array();
252
        $Urls                      = $this->getOrderUrls($order); // On récupère les URL des fichiers à télécharger
253
        $msg['ADDITIONAL_CONTENT'] = '';
254
        $msg['NUM_COMMANDE']       = $order->getVar('cmd_id');
255
        $msg['COMMENT']            = $comment;
256
        if (count($Urls) > 0) {
257
            $msg['ADDITIONAL_CONTENT'] = _OLEDRION_YOU_CAN_DOWNLOAD . "\n" . implode("\n", $Urls);
258
        }
259
        OledrionUtility::sendEmailFromTpl('command_shop_verified.tpl', OledrionUtility::getEmailsFromGroup(OledrionUtility::getModuleOption('grp_sold')), _OLEDRION_GATEWAY_VALIDATED, $msg);
260
        OledrionUtility::sendEmailFromTpl('command_client_verified.tpl', $order->getVar('cmd_email'), sprintf(_OLEDRION_GATEWAY_VALIDATED, $xoopsConfig['sitename']), $msg);
261
    }
262
263
    /**
264
     * Validation d'une commande et mise à jour des stocks
265
     *
266
     * @param  object|Oledrion_commands $order   La commande à traiter
267
     * @param  string                   $comment Optionel, un commentaire pour le mail envoyé au webmaster
268
     * @return bool                     Indique si la validation de la commande s'est bien faite ou pas
269
     */
270
    public function validateOrder(Oledrion_commands $order, $comment = '')
271
    {
272
        $retval = false;
273
        $order->setVar('cmd_state', OLEDRION_STATE_VALIDATED);
274
        $order->setVar('cmd_comment', $comment);
275
        $retval = $this->insert($order, true);
276
        if ($retval) {
277
            $this->updateStocks($order);
278
            // B.R. Validation emails redundant since order emails now sent @gateway (paypal) validation
279
            // B.R. $this->notifyOrderValidated($order, $comment);
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
280
        }
281
282
        return $retval;
283
    }
284
285
    /**
286
     * pack d'une commande et mise à jour des stocks
287
     *
288
     * @param  object|Oledrion_commands $order   La commande à traiter
289
     * @param  string                   $comment Optionel, un commentaire pour le mail envoyé au webmaster
290
     * @return bool                     Indique si la validation de la commande s'est bien faite ou pas
291
     */
292 View Code Duplication
    public function packOrder(Oledrion_commands $order, $comment = '')
293
    {
294
        $retval = false;
295
        $order->setVar('cmd_state', OLEDRION_STATE_PACKED);
296
        $order->setVar('cmd_comment', $comment);
297
        $retval = $this->insert($order, true);
298
299
        return $retval;
300
    }
301
302
    /**
303
     * submit d'une commande et mise à jour des stocks
304
     *
305
     * @param  object|Oledrion_commands $order   La commande à traiter
306
     * @param  string                   $comment Optionel, un commentaire pour le mail envoyé au webmaster
307
     * @return bool                     Indique si la validation de la commande s'est bien faite ou pas
308
     */
309 View Code Duplication
    public function submitOrder(Oledrion_commands $order, $comment = '')
310
    {
311
        $retval = false;
312
        $order->setVar('cmd_state', OLEDRION_STATE_SUBMITED);
313
        $order->setVar('cmd_comment', $comment);
314
        $retval = $this->insert($order, true);
315
316
        return $retval;
317
    }
318
319
    /**
320
     * delivery d'une commande et mise à jour des stocks
321
     *
322
     * @param  object|Oledrion_commands $order   La commande à traiter
323
     * @param  string                   $comment Optionel, un commentaire pour le mail envoyé au webmaster
324
     * @return bool                     Indique si la validation de la commande s'est bien faite ou pas
325
     */
326 View Code Duplication
    public function deliveryOrder(Oledrion_commands $order, $comment = '')
327
    {
328
        $retval = false;
329
        $order->setVar('cmd_state', OLEDRION_STATE_DELIVERYED);
330
        $order->setVar('cmd_comment', $comment);
331
        $retval = $this->insert($order, true);
332
333
        return $retval;
334
    }
335
336
    /**
337
     * Informe le propriétaire du site qu'une commande est frauduleuse
338
     *
339
     * @param object|Oledrion_commands $order   La commande en question
340
     * @param string                   $comment Optionel, un commentaire pour le mail envoyé au webmaster
341
     */
342 View Code Duplication
    public function notifyOrderFraudulent(Oledrion_commands $order, $comment = '')
343
    {
344
        $msg                 = array();
345
        $msg['NUM_COMMANDE'] = $order->getVar('cmd_id');
346
        $msg['COMMENT']      = $comment;
347
        OledrionUtility::sendEmailFromTpl('command_shop_fraud.tpl', OledrionUtility::getEmailsFromGroup(OledrionUtility::getModuleOption('grp_sold')), _OLEDRION_GATEWAY_FRAUD, $msg);
348
    }
349
350
    /**
351
     * Applique le statut de commande frauduleuse à une commande
352
     *
353
     * @param obejct|Oledrion_commands $order   La commande à traiter
354
     * @param string                   $comment Optionel, un commentaire pour le mail envoyé au webmaster
355
     */
356
    public function setFraudulentOrder(Oledrion_commands $order, $comment = '')
357
    {
358
        $order->setVar('cmd_state', OLEDRION_STATE_FRAUD);
359
        $order->setVar('cmd_comment', $comment);
360
        $this->insert($order, true);
361
        $this->notifyOrderFraudulent($order, $comment);
362
    }
363
364
    /**
365
     * Informe le propriétaire du site qu'une commande est en attente
366
     *
367
     * @param object|Oledrion_commands $order   La commande en question
368
     * @param string                   $comment Optionel, un commentaire pour le mail envoyé au webmaster
369
     */
370 View Code Duplication
    public function notifyOrderPending(Oledrion_commands $order, $comment = '')
371
    {
372
        $msg                 = array();
373
        $msg['NUM_COMMANDE'] = $order->getVar('cmd_id');
374
        $msg['COMMENT']      = $comment;
375
        OledrionUtility::sendEmailFromTpl('command_shop_pending.tpl', OledrionUtility::getEmailsFromGroup(OledrionUtility::getModuleOption('grp_sold')), _OLEDRION_GATEWAY_PENDING, $msg);
376
    }
377
378
    /**
379
     * Applique le statut de commande en attente à une commande
380
     *
381
     * @param object|Oledrion_commands $order   La commande à traiter
382
     * @param string                   $comment Optionel, un commentaire pour le mail envoyé au webmaster
383
     */
384
    public function setOrderPending(Oledrion_commands $order, $comment = '')
385
    {
386
        $order->setVar('cmd_state', OLEDRION_STATE_PENDING); // En attente
387
        $order->setVar('cmd_comment', $comment);
388
        $this->insert($order, true);
389
        $this->notifyOrderPending($order, $comment);
390
    }
391
392
    /**
393
     * Informe le propriétaire du site qu'une commande à échoué (le paiement)
394
     *
395
     * @param object|Oledrion_commands $order   La commande en question
396
     * @param string                   $comment Optionel, un commentaire pour le mail envoyé au webmaster
397
     */
398 View Code Duplication
    public function notifyOrderFailed(Oledrion_commands $order, $comment = '')
399
    {
400
        $msg                 = array();
401
        $msg['NUM_COMMANDE'] = $order->getVar('cmd_id');
402
        $msg['COMMENT']      = $comment;
403
        OledrionUtility::sendEmailFromTpl('command_shop_failed.tpl', OledrionUtility::getEmailsFromGroup(OledrionUtility::getModuleOption('grp_sold')), _OLEDRION_GATEWAY_FAILED, $msg);
404
    }
405
406
    /**
407
     * Applique le statut de commande échouée à une commande
408
     *
409
     * @param object|Oledrion_commands $order   La commande à traiter
410
     * @param string                   $comment Optionel, un commentaire pour le mail envoyé au webmaster
411
     */
412
    public function setOrderFailed(Oledrion_commands $order, $comment = '')
413
    {
414
        $order->setVar('cmd_state', OLEDRION_STATE_FAILED); // Echec
415
        $order->setVar('cmd_comment', $comment);
416
        $this->insert($order, true);
417
        $this->notifyOrderFailed($order, $comment);
418
    }
419
420
    /**
421
     * Informe le propriétaire du site qu'une commande à échoué (le paiement)
422
     *
423
     * @param object|Oledrion_commands $order   La commande en question
424
     * @param string                   $comment Optionel, un commentaire pour le mail envoyé au webmaster
425
     */
426
    public function notifyOrderCanceled(Oledrion_commands $order, $comment = '')
427
    {
428
        $msg                 = array();
429
        $msg['NUM_COMMANDE'] = $order->getVar('cmd_id');
430
        $msg['COMMENT']      = $comment;
431
        OledrionUtility::sendEmailFromTpl('command_shop_cancel.tpl', OledrionUtility::getEmailsFromGroup(OledrionUtility::getModuleOption('grp_sold')), _OLEDRION_ORDER_CANCELED, $msg);
432
        OledrionUtility::sendEmailFromTpl('command_client_cancel.tpl', $order->getVar('cmd_email'), _OLEDRION_ORDER_CANCELED, $msg);
433
    }
434
435
    /**
436
     * Applique le statut de commande annulée à une commande
437
     *
438
     * @param object|Oledrion_commands $order   La commande à traiter
439
     * @param string                   $comment Optionel, un commentaire pour le mail envoyé au webmaster
440
     */
441
    public function setOrderCanceled(Oledrion_commands $order, $comment = '')
442
    {
443
        $order->setVar('cmd_state', OLEDRION_STATE_CANCELED); // Annulée
444
        $order->setVar('cmd_comment', $comment);
445
        $this->insert($order, true);
446
        $this->notifyOrderCanceled($order, $comment);
447
    }
448
449
    /**
450
     * Retourne une commande à partir de son mot de passe d'annulation
451
     *
452
     * @param  string $cmd_cancel Le mot de passe d'annulation
453
     * @return mixed  Soit un objet soit null
454
     */
455
    public function getOrderFromCancelPassword($cmd_cancel)
456
    {
457
        $critere = new Criteria('cmd_cancel', $cmd_cancel, '=');
458
        if ($this->getCount($critere) > 0) {
459
            $tblCmd = array();
460
            $tblCmd = $this->getObjects($critere);
461
            if (count($tblCmd) > 0) {
462
                return $tblCmd[0];
463
            }
464
        }
465
466
        return null;
467
    }
468
469
    /**
470
     * Retourne la dernière commande d'un utilisateur (si elle existe)
471
     *
472
     * @param  integer $uid Identifiant de la commande
473
     * @return null
474
     */
475
    public function getLastUserOrder($uid)
476
    {
477
        $order    = null;
478
        $orders   = array();
479
        $criteria = new CriteriaCompo();
480
        $criteria->add(new Criteria('cmd_uid', $uid));
481
        $criteria->add(new Criteria('cmd_status', 2));
482
        $criteria->setSort('cmd_date');
483
        $criteria->setOrder('DESC');
484
        $criteria->setLimit(1);
485
        $orders = $this->getObjects($criteria, false);
486
        if (count($orders) > 0) {
487
            $order = $orders[0];
488
        }
489
490
        return $order;
491
    }
492
493
    /**
494
     * Supprime une commande et tout ce qui s'y rattache
495
     *
496
     * @param  oledrion_commands $order
497
     * @return boolean
498
     */
499
    public function removeOrder(Oledrion_commands $order)
500
    {
501
        $handlers = OledrionHandler::getInstance();
502
        $cmd_id   = $order->getVar('cmd_id');
503
        $res      = $this->delete($order);
504
        // Suppression des objets associés
505
        // 1) Ses propres caddies
506
        $handlers->h_oledrion_caddy->removeCartsFromOrderId($cmd_id);
507
        // 2) Les caddies des attributs
508
        $handlers->h_oledrion_caddy_attributes->removeCartsFromOrderId($cmd_id);
509
510
        return $res;
511
    }
512
}
513