id_cart = (int)$id_cart; $soDelivery->id_customer = (int)$this->context->customer->id; $soDelivery->loadDelivery(); $phone = trim(Tools::getValue('phone')); $info = trim(Tools::getValue('infoDelivery')); $email = trim(Tools::getValue('email')); $delivery_mode = Tools::strtoupper(trim(Tools::getValue('delivery_mode'))); if ($phone && $soDelivery->telephone != $phone) { $soDelivery->telephone = pSQL(str_replace(' ', '', $phone)); $update_required = true; } if ($info && $soDelivery->informations != $info) { $soDelivery->informations = pSQL($info); $update_required = true; } if ($email && $soDelivery->email != $email) { $soDelivery->email = pSQL($email); $update_required = true; } if ($delivery_mode && $soDelivery->type != $delivery_mode) { $soDelivery->type = pSQL($delivery_mode); $update_required = true; } if ($update_required) { $status = $soDelivery->saveDelivery() ? true : false; } $result = ob_get_clean(); if ($result) { $output = $result; } else { $output = null; } $json = array( 'output' => $output, 'status' => $status, 'phone' => $phone, 'mail' => $email, 'info' => $info ); die(Tools::jsonEncode($json)); } } $soflexibilite_saveinfocommande = new SoFlexibiliteSaveInfoCommande(); $soflexibilite_saveinfocommande->save();