Vérifier le formulaire'; } else { $sale = Sale::getSaleFromCategory((int) $id_category); $category = new Category($id_category, $cookie->id_lang); $id_status = $status_pending? array(19):NULL; $orders_single = $sale->getOrdersFromSale($id_status, TRUE); $orders_multiple = $sale->getOrdersFromSale($id_status, FALSE); if($type_envoi == 0) { $orders = array_merge($orders_multiple, $orders_single); } else if($type_envoi == 1) { $orders = $orders_multiple; } else if($type_envoi == 2) { $orders = $orders_single; } $orders = array_unique($orders); if(Tools::isSubmit('submitEnvoi')) { $this->displayConfirmationForm($category, $type_envoi, $contenu_mail, count($orders), $sale, $objet_mail, $envoi_remise, $montant_remise, $prefix_remise, $status_pending); } else if(Tools::isSubmit('confirmationEnvoi')) { $contenu_mail = str_replace("%marque%", $category->name , $contenu_mail); $mail = 0; $mails_errors = array(); foreach ($orders as $key => $order) { $data = new Order($order); if($envoi_remise == 1){ $params = array( 'id_customer' => $data->id_customer, 'currency' => 1, 'description' => Configuration::get('MAIL_PS_DESC'), 'value' => (int) $montant_remise, 'prefix' => $prefix_remise ); $discount = $this->_register_discount($params); $contenu_mail = str_replace("%montant%", (int)$montant_remise , $contenu_mail); $contenu_mail = str_replace("%discount%", $discount->name , $contenu_mail); } $customer = new Customer($data->id_customer); $send = Mail::Send( $cookie->id_lang, 'ps_delay', $objet_mail, array( '{message}' => $contenu_mail ), $customer->email, $customer->firstname.' '.$customer->lastname, strval(Configuration::get('PS_SHOP_EMAIL')), strval(Configuration::get('PS_SHOP_NAME')), NULL, NULL, dirname(__FILE__).'/mails/' ); //$send = true; if(!$send){ $mails_errors[] = $data->id; } $mail++; } $send = Mail::Send( $cookie->id_lang, 'ps_delay', $objet_mail, array( '{message}' => $contenu_mail ), 'contact@bebeboutik.com', 'Bebeboutik Contact', strval(Configuration::get('PS_SHOP_EMAIL')), strval(Configuration::get('PS_SHOP_NAME')), NULL, NULL, dirname(__FILE__).'/mails/' ); if( count($mails_errors) > 0) { echo '