category = new Category(Tools::getValue("id")); } if(Tools::getValue("actionform") == 'delete') { if(Tools::getValue('idorderform') !== false && Validate::isLoadedObject($order_form = new OrderForm((int)Tools::getValue('idorderform')))) { if($order_form->delete()) echo 'Suppression effectuée'; else echo 'Erreur durant la suppression'; } else echo 'Mauvais id de bon de commande'; exit; } if(Tools::getValue("action") == 'getSaleExport') { $this->getSaleExport(); } if(Tools::isSubmit('submitExport')) { $id_lang = Tools::getValue('export_id_lang', $cookie->id_lang); if ($id_category = (int) Tools::getValue('export_category')) { $this->getSaleExport($id_category, $id_lang); } elseif (Tools::getValue('date_start') && Tools::getValue('date_end')) { $date_start = Tools::getValue('date_start'); $date_end = Tools::getValue('date_end'); $this->getSaleExportsByDate($date_start, $date_end, $id_lang); } else { HelperFormBootstrap::displayErrors($this->l('Vous devez choisir une vente ou une période')); } } } public function _displayHeader($helperForm) { global $currentIndex; $helperForm->_select2 = true; $helperForm->_dateTimePicker = true; $helperForm->_inputSwitch = true; $helperForm->_inputMask = true; $helperForm->_css .= ' #content .bootstrap-datetimepicker-widget tr th { border-radius :0px !important; } '; $this->html .= $helperForm->renderStyle(); $helperForm->_js .= ' '; } public function _displayAfterContent($helperForm, $option_sales,$option_select_langs) { global $cookie; $this->html .= '
Aucune vente !
'; } $this->html .= ''.$stats->lang['date_start'].' | '; $html.= ''.$stats->data_stats['date_start'].' | '; $html.= '
'.$stats->lang['date_end'].' | '; $html.= ''.$stats->data_stats['date_end'].' | '; $html.= '
'.$stats->lang['duration'].' | '; $html.= ''.$stats->data_stats['duration'].' | '; $html.= '
STATS VENTES | |
'.$stats->lang['nb_ref'].' | '; $html.= ''.$stats->data_stats['nb_ref'].' | '; $html.= '
'.$stats->lang['nb_quantity_start'].' | '; $html.= ''.$stats->data_stats['nb_quantity_start'].' | '; $html.= '
'.$stats->lang['nb_order_simple'].' | '; $html.= ''.$stats->data_stats['nb_order_simple'].' | '; $html.= '
'.$stats->lang['nb_order_multi'].' | '; $html.= ''.$stats->data_stats['nb_order_multi'].' | '; $html.= '
'.$stats->lang['nb_order_total'].' | '; $html.= ''.$stats->data_stats['nb_order_total'].' | '; $html.= '
'.$stats->lang['taux_multi'].' | '; $html.= ''.$stats->data_stats['taux_multi'].' | '; $html.= '
'.$stats->lang['quantity_sale'].' | '; $html.= ''.$stats->data_stats['quantity_sale'].' | '; $html.= '
'.$stats->lang['percent_sale'].' | '; $html.= ''.$stats->data_stats['percent_sale'].' | '; $html.= '
'.$stats->lang['percent_out_of_stock'].' | '; $html.= ''.$stats->data_stats['percent_out_of_stock'].' | '; $html.= '
'.$stats->lang['ca_ttc'].' | '; $html.= ''.Tools::displayPrice($stats->data_stats['ca_ttc']).' | '; $html.= '
'.$stats->lang['total_bdc_ht'].' | '; $html.= ''.Tools::displayPrice($stats->data_stats['total_bdc_ht']).' | '; $html.= '
'.$stats->lang['marge'].' | '; $html.= ''.$stats->data_stats['marge'].' | '; $html.= '
BEST SELLERS | |
'.$stats->lang['bestsale_'.$i.'_product'].' | '; $html.= ''.$stats->data_stats['bestsale_'.$i.'_product'].' - '.$stats->data_stats['bestsale_'.$i.'_ref'].' | '; $html.= '
'.$stats->lang['bestsale_'.$i.'_quantity'].' | '; $html.= ''.$stats->data_stats['bestsale_'.$i.'_quantity'].' | '; $html.= '
'.$stats->lang['bestsale_'.$i.'_ca'].' | '; $html.= ''.Tools::displayPrice($stats->data_stats['bestsale_'.$i.'_ca']).' | '; $html.= '
SOUS CATEGORIES | '; $html.= '||
'.$stats->lang[$key_2].' | '; if ($key_2 == 'total_amount_wholesale_price') { $html.= ''.Tools::displayPrice($subcategory).' | '; } else { $html.= ''.$subcategory.' | '; } $html.= '
'.$this->l('ID').' | '.$this->l('Date de d\'export').' | '.$this->l('A partir de').' | '.$this->l('Jusqu\'a').' | '.$this->l('Exporter à nouveau').' |
---|---|---|---|---|
'.$export['id_order_form'].' | '.$export['date_add'].' | '.$export['from'].' | '.$export['to'].' | '; // $html .=' FR EN |
'.$this->l('Il n\'y a pas d\'anciens exports de bon de commande').'
'; } $html .= 'Choisir une plage moins grande.
Export > 20000 produits
Erreur produit: '.serialize($product).' ce produit ne figure pas dans l\'export
'; } else { $position = Db::getInstance()->getValue(' SELECT `position` FROM `'._DB_PREFIX_.'category_product` WHERE `id_category` = '.(int) $p->id_category_default.' AND id_product = '. (int) $p->id . ' '); $p->position = $position; $categories = array(); foreach(Db::getInstance()->ExecuteS(' SELECT `id_category` FROM `'._DB_PREFIX_.'category_product` WHERE `id_product` = '.(int) $p->id.' ') as $cat) { $categories[] = (int) $cat['id_category']; } sort($categories); $categories_title = array(); foreach ($categories as $category) { $title = Db::getInstance()->getValue(' SELECT `name` FROM `'._DB_PREFIX_.'category_lang` WHERE `id_category` = '.(int) $category.' AND id_lang = '. $id_lang . ' '); $categories_title[] = $title; } $categorie_0 = ''; $categorie_1 = ''; $categorie_2 = ''; foreach ($categories as $key => $cat) { if ($key == 0) { $categorie_0 = $categories_title[$cat]; } elseif ($key == 1) { $categorie_1 = $categories_title[$cat]; } elseif ($key == 2) { $categorie_2 = $categories_title[$cat]; } } $combinations = array(); foreach($p->getAttributeCombinaisons($id_lang) as $combi) { if(!isset($combinations[$combi['id_product_attribute']])) { $combinations[$combi['id_product_attribute']] = array( 'qty' => $combi['quantity'], 'name' => array($combi['attribute_name']), 'ean13' => $combi['ean13'], 'location' => empty($combi['location'])? $p->location: $combi['location'], 'brand' => $p->manufacturer_name, 'supplier_reference' => empty($combi['supplier_reference'])? $p->supplier_reference: $combi['supplier_reference'], ); } else { $combinations[$combi['id_product_attribute']]['name'][] = $combi['attribute_name']; } } $images = array(); foreach(Db::getInstance()->ExecuteS(' SELECT i.`id_image`, l.`legend` FROM `'._DB_PREFIX_.'image` i LEFT JOIN `'._DB_PREFIX_.'image_lang` l ON l.`id_image` = i.`id_image` WHERE l.`id_lang` = '.(int) $id_lang.' AND i.`id_product` = '.(int) $p->id.' ORDER BY i.`position` ') as $img) { $link_image = str_split($img['id_image']); $images[] = 'https://static.bebeboutik.com/img/p/'.implode('/', $link_image) .'/'. $img['id_image'].'.jpg'; } if(count($combinations) > 0) { foreach($combinations as $k => $v) { $c_images = array(); foreach(Db::getInstance()->ExecuteS(' SELECT i.`id_image`, l.`legend` FROM `'._DB_PREFIX_.'image` i LEFT JOIN `'._DB_PREFIX_.'image_lang` l ON l.`id_image` = i.`id_image` LEFT JOIN `'._DB_PREFIX_.'product_attribute_image` a ON a.`id_image` = i.`id_image` WHERE l.`id_lang` = '.(int) $id_lang.' AND a.`id_product_attribute` = '.(int) $k.' ') as $img) { $link_image = str_split($img['id_image']); $c_images[] = 'https://static.bebeboutik.com/img/p/'.implode('/', $link_image) .'/'. $img['id_image'].'.jpg'; // $c_images[] = 'http://static.bebeboutik.com/'.(int) $p->id.'-'.$img['id_image'].'.jpg'; } $names = array_unique($v['name']); sort($names, SORT_STRING); $quantity_sold = (int) Db::getInstance()->getValue(' SELECT SUM(d.`product_quantity` - d.`product_quantity_reinjected`) FROM `'._DB_PREFIX_.'order_detail` d LEFT JOIN `'._DB_PREFIX_.'orders` o ON o.`id_order` = d.`id_order` WHERE d.`product_id` = '.(int) $p->id.' AND d.`product_attribute_id` = '.(int) $k.' AND ( SELECT `id_order_state` FROM `'._DB_PREFIX_.'order_history` oh WHERE o.`id_order` = oh.`id_order` ORDER BY `id_order_history` DESC LIMIT 1 ) IN ("'.implode('","', $order_states).'") '); // $quantity_sold = (int) Db::getInstance()->getValue(' // SELECT SUM(d.`product_quantity`) // FROM `'._DB_PREFIX_.'order_detail` d // LEFT JOIN `'._DB_PREFIX_.'orders` o // ON o.`id_order` = d.`id_order` // LEFT JOIN `'._DB_PREFIX_.'order_history` h // ON h.`id_order` = d.`id_order` // WHERE d.`product_id` = '.(int) $p->id.' // AND d.`product_attribute_id` = '.(int) $k.' // AND h.`id_order_state` = 2 // '); $customs = Db::getInstance()->getRow(' SELECT `nc8`, `id_country` FROM `'._DB_PREFIX_.'product_customs` WHERE `id_product` = '.(int) $p->id ); fputcsv($f, array( $v['supplier_reference'], $v['ean13'], $p->id, $k, $p->position, str_replace('.', ',', $p->weight), ($v['qty']+$quantity_sold), $quantity_sold, $v['qty'], $p->name[$id_lang], implode(' - ', $names), $customs['nc8'], $customs['id_country'], // $v['location'], // $v['brand'], str_replace('.', ',', $p->getPrice(TRUE, (int) $k, 2, NULL, FALSE, FALSE)), str_replace('.', ',', $p->getPrice(TRUE, (int) $k, 2)), str_replace('.', ',', Tools::ps_round($p->wholesale_price, 2)), str_replace('.', ',', Tools::ps_round(($quantity_sold * $p->wholesale_price),2)), // $p->active, $p->description_short[$id_lang], $p->description[$id_lang], $p->description_more[$id_lang], $p->videos[$id_lang], $p->description_delivery[$id_lang], count($c_images) > 0? implode(', ', $c_images): implode(', ', $images), $categorie_0, $categorie_1, $categorie_2, // implode(', ', $categories), // implode(', ', $categories_title), ), ';', '"'); } } else { $quantity_sold = (int) Db::getInstance()->getValue(' SELECT SUM(d.`product_quantity` - d.`product_quantity_reinjected`) FROM `'._DB_PREFIX_.'order_detail` d LEFT JOIN `'._DB_PREFIX_.'orders` o ON o.`id_order` = d.`id_order` WHERE d.`product_id` = '.(int) $p->id.' AND d.`product_attribute_id` = 0 AND ( SELECT `id_order_state` FROM `'._DB_PREFIX_.'order_history` oh WHERE o.`id_order` = oh.`id_order` ORDER BY `id_order_history` DESC LIMIT 1 ) IN ("'.implode('","', $order_states).'") '); // $quantity_sold = (int) Db::getInstance()->getValue(' // SELECT SUM(d.`product_quantity`) // FROM `'._DB_PREFIX_.'order_detail` d // LEFT JOIN `'._DB_PREFIX_.'orders` o // ON o.`id_order` = d.`id_order` // LEFT JOIN `'._DB_PREFIX_.'order_history` h // ON h.`id_order` = d.`id_order` // WHERE d.`product_id` = '.(int) $p->id.' // AND h.`id_order_state` = 2 // '); $customs = Db::getInstance()->getRow(' SELECT `nc8`, `id_country` FROM `'._DB_PREFIX_.'product_customs` WHERE `id_product` = '.(int) $p->id ); fputcsv($f, array( $p->supplier_reference, $p->ean13, $p->id, 0, $p->position, str_replace('.', ',', $p->weight), ($p->quantity+$quantity_sold), $quantity_sold, $p->quantity, $p->name[$id_lang], '', $customs['nc8'], $customs['id_country'], // $p->location, // $p->manufacturer_name, str_replace('.', ',', $p->getPrice(TRUE, NULL, 2, NULL, FALSE, FALSE)), str_replace('.', ',', $p->getPrice(TRUE, NULL, 2)), str_replace('.', ',', Tools::ps_round($p->wholesale_price, 2)), str_replace('.', ',', Tools::ps_round(($quantity_sold * $p->wholesale_price),2)), // $p->active, $p->description_short[$id_lang], $p->description[$id_lang], $p->description_more[$id_lang], $p->videos[$id_lang], $p->description_delivery[$id_lang], implode(', ', $images), $categorie_0, $categorie_1, $categorie_2, // implode(', ', $categories), // implode(', ', $categories_title), ), ';', '"'); } } } fclose($f); $this->html .= ''.$this->l('Export complete.').' '.$this->l('Click here to download the file').'
'; } public function getSaleExport($id_category=0,$id_lang=0) { global $link, $cookie; require_once(_PS_ROOT_DIR_.'/modules/privatesales/Sale.php'); set_time_limit(300); if($id_category == 0){ $id_category = (int)Tools::getValue('id'); } if($id_lang == 0) { $id_lang = $cookie->id_lang; } $order_states = explode(',', Configuration::get('PS_IT_OF_ORDER_STATES')); $sale = Sale::getSaleFromCategory($id_category); $category = new Category($id_category, $cookie->id_lang); if ($category) { $c = $category; $children = $c->recurseLiteCategTree(5, 0, $id_lang); $ids = $this->_recurse_array(array($children)); $products = array(); foreach($c->getProductsWs() as $p) { $products[] = $p['id']; } foreach($ids as $id) { $sc = new Category($id, $id_lang); foreach($sc->getProductsWs() as $p) { $products[] = $p['id']; } } $products = array_unique($products); $fname = date( "Ymd", strtotime($sale->date_start)).'-'.$sale->title[(int)$id_lang].'-'.$id_category.'.csv'; foreach(glob(dirname(__FILE__).'/*.csv') as $filename) { if ($fname == $filename) { unlink($filename); } } $f = fopen(dirname(__FILE__).'/'.$fname, 'w'); // uft8 sans bom pour accent $BOM = "\xEF\xBB\xBF"; // UTF-8 BOM fwrite($f, $BOM); // NEW LINE fputcsv($f, array( 'supplier_reference', 'ean13', 'id_product', 'id_product_attribute', 'position', 'poids', 'stock_initial', 'quantity_sold', 'quantity', 'product_name', 'combination', 'NC8', 'Pays de fabrication', 'public_price_wt', 'price_wt', 'wholesale_price', 'BDC HT', 'id_TVA', 'description_short', 'bon_a_savoir', 'plus', 'videos', 'livraison', 'images', 'nb_images', 'categories', 'sous-categories', 'sous-sous-categories', ), ';', '"'); foreach($products as $product) { $p = new Product((int) $product, $id_lang); if(!Validate::isLoadedObject($p)) { $this->html .= 'Erreur produit: '.serialize($product).' ce produit ne figure pas dans l\'export
'; } else { $position = Db::getInstance()->getValue(' SELECT `position` FROM `'._DB_PREFIX_.'category_product` WHERE `id_category` = '.(int) $id_category.' AND id_product = '. (int) $p->id . ' '); $p->position = $position; $categories = array(); foreach(Db::getInstance()->ExecuteS(' SELECT `id_category` FROM `'._DB_PREFIX_.'category_product` WHERE `id_product` = '.(int) $p->id.' ') as $cat) { $categories[] = (int) $cat['id_category']; } sort($categories); $categories_title = array(); foreach ($categories as $category) { $title = Db::getInstance()->getValue(' SELECT `name` FROM `'._DB_PREFIX_.'category_lang` WHERE `id_category` = '.(int) $category.' AND id_lang = '. $id_lang . ' '); $categories_title[(int) $category] = $title; } $categorie_0 = ''; $categorie_1 = ''; $categorie_2 = ''; foreach ($categories as $key => $cat) { if ($key == 0) { $categorie_0 = $categories_title[$cat]; } elseif ($key == 1) { $categorie_1 = $categories_title[$cat]; } elseif ($key == 2) { $categorie_2 = $categories_title[$cat]; } } $combinations = array(); foreach($p->getAttributeCombinaisons($id_lang) as $combi) { if(!isset($combinations[$combi['id_product_attribute']])) { $combinations[$combi['id_product_attribute']] = array( 'qty' => $combi['quantity'], 'name' => array($combi['attribute_name']), 'ean13' => $combi['ean13'], 'location' => empty($combi['location'])? $p->location: $combi['location'], 'brand' => $p->manufacturer_name, 'supplier_reference' => empty($combi['supplier_reference'])? $p->supplier_reference: $combi['supplier_reference'], ); } else { $combinations[$combi['id_product_attribute']]['name'][] = $combi['attribute_name']; } } $images = array(); foreach(Db::getInstance()->ExecuteS(' SELECT i.`id_image`, l.`legend` FROM `'._DB_PREFIX_.'image` i LEFT JOIN `'._DB_PREFIX_.'image_lang` l ON l.`id_image` = i.`id_image` WHERE l.`id_lang` = '.(int) $id_lang.' AND i.`id_product` = '.(int) $p->id.' ') as $img) { $link_image = str_split($img['id_image']); $images[] = 'https://static.bebeboutik.com/img/p/'.implode('/', $link_image) .'/'. $img['id_image'].'.jpg'; } $customs = Db::getInstance()->getRow(' SELECT `nc8`, `id_country` FROM `'._DB_PREFIX_.'product_customs` WHERE `id_product` = '.(int) $p->id ); if(count($combinations) > 0) { foreach($combinations as $k => $v) { $c_images = array(); foreach(Db::getInstance()->ExecuteS(' SELECT i.`id_image`, l.`legend` FROM `'._DB_PREFIX_.'image` i LEFT JOIN `'._DB_PREFIX_.'image_lang` l ON l.`id_image` = i.`id_image` LEFT JOIN `'._DB_PREFIX_.'product_attribute_image` a ON a.`id_image` = i.`id_image` WHERE l.`id_lang` = '.(int) $id_lang.' AND a.`id_product_attribute` = '.(int) $k.' ORDER BY i.`position` ') as $img) { $link_image = str_split($img['id_image']); $c_images[] = 'https://static.bebeboutik.com/img/p/'.implode('/', $link_image) .'/'. $img['id_image'].'.jpg'; } $quantity_sold = (int) Db::getInstance()->getValue(' SELECT SUM(d.`product_quantity` - d.`product_quantity_reinjected`) FROM `'._DB_PREFIX_.'order_detail` d LEFT JOIN `'._DB_PREFIX_.'orders` o ON o.`id_order` = d.`id_order` WHERE d.`product_id` = '.(int) $p->id.' AND d.`product_attribute_id` = '.(int) $k.' AND ( SELECT `id_order_state` FROM `'._DB_PREFIX_.'order_history` oh WHERE o.`id_order` = oh.`id_order` ORDER BY `id_order_history` DESC LIMIT 1 ) IN ("'.implode('","', $order_states).'") '); // $quantity_sold = (int) Db::getInstance()->getValue(' // SELECT SUM(d.`product_quantity`) // FROM `'._DB_PREFIX_.'order_detail` d // LEFT JOIN `'._DB_PREFIX_.'orders` o // ON o.`id_order` = d.`id_order` // LEFT JOIN `'._DB_PREFIX_.'order_history` h // ON h.`id_order` = d.`id_order` // WHERE d.`product_id` = '.(int) $p->id.' // AND d.`product_attribute_id` = '.(int) $k.' // AND h.`id_order_state` = 2 // '); $names = array_unique($v['name']); sort($names, SORT_STRING); fputcsv($f, array( $v['supplier_reference'], $v['ean13'], $p->id, $k, $p->position, str_replace('.', ',', $p->weight), ($v['qty']+$quantity_sold), $quantity_sold, $v['qty'], $p->name[$id_lang], implode(' - ', $names), $customs['nc8'], $customs['id_country'], str_replace('.', ',', $p->getPrice(TRUE, (int) $k, 2, NULL, FALSE, FALSE)), str_replace('.', ',', $p->getPrice(TRUE, (int) $k, 2)), str_replace('.', ',', Tools::ps_round($p->wholesale_price, 2)), str_replace('.', ',', Tools::ps_round(($quantity_sold * $p->wholesale_price),2)), $p->id_tax_rules_group, // $p->active, $p->description_short[$id_lang], $p->description[$id_lang], $p->description_more[$id_lang], $p->videos[$id_lang], $p->description_delivery[$id_lang], count($c_images) > 0? implode(', ', $c_images): implode(', ', $images), count($c_images) > 0? count($c_images): count($images), $categorie_0, $categorie_1, $categorie_2, ), ';', '"'); } } else { $quantity_sold = (int) Db::getInstance()->getValue(' SELECT SUM(d.`product_quantity` - d.`product_quantity_reinjected`) FROM `'._DB_PREFIX_.'order_detail` d LEFT JOIN `'._DB_PREFIX_.'orders` o ON o.`id_order` = d.`id_order` WHERE d.`product_id` = '.(int) $p->id.' AND d.`product_attribute_id` = 0 AND ( SELECT `id_order_state` FROM `'._DB_PREFIX_.'order_history` oh WHERE o.`id_order` = oh.`id_order` ORDER BY `id_order_history` DESC LIMIT 1 ) IN ("'.implode('","', $order_states).'") '); // $quantity_sold = (int) Db::getInstance()->getValue(' // SELECT SUM(d.`product_quantity`) // FROM `'._DB_PREFIX_.'order_detail` d // LEFT JOIN `'._DB_PREFIX_.'orders` o // ON o.`id_order` = d.`id_order` // LEFT JOIN `'._DB_PREFIX_.'order_history` h // ON h.`id_order` = d.`id_order` // WHERE d.`product_id` = '.(int) $p->id.' // AND h.`id_order_state` = 2 // '); fputcsv($f, array( $p->supplier_reference, $p->ean13, $p->id, 0, $p->position, str_replace('.', ',', $p->weight), ($p->quantity+$quantity_sold), $quantity_sold, $p->quantity, $p->name[$id_lang], '', $customs['nc8'], $customs['id_country'], str_replace('.', ',', $p->getPrice(TRUE, NULL, 2, NULL, FALSE, FALSE)), str_replace('.', ',', $p->getPrice(TRUE, NULL, 2)), str_replace('.', ',', Tools::ps_round($p->wholesale_price, 2)), str_replace('.', ',', Tools::ps_round(($quantity_sold * $p->wholesale_price),2)), $p->id_tax_rules_group, $p->description_short[$id_lang], $p->description[$id_lang], $p->description_more[$id_lang], $p->videos[$id_lang], $p->description_delivery[$id_lang], implode(', ', $images), count($images), $categorie_0, $categorie_1, $categorie_2, ), ';', '"'); } } } fclose($f); $this->html .= ''.$this->l('Export complete.').' '.$this->l('Click here to download the file').'
'; } } public function getFormOrderFormInfo() { global $cookie; $html = ''; $array_lang = array( 'fr', 'en' ); $array = array( 'PS_IT_OF_ORGANISATION' => array( 'form_organisation', 'Organisation :' ), 'PS_IT_OF_SLOGAN' => array( 'form_slogan', 'Slogan :' ), 'PS_IT_OF_EMAIL' => array( 'form_email', 'Email :' ), 'PS_IT_OF_TVA' => array( 'form_tva', 'TVA :' ), 'PS_IT_OF_ADDRESS' => array( 'form_address', 'Adresse partie 1 :' ), 'PS_IT_OF_ADDRESS_2' => array( 'form_address_2', 'Adresse partie 2 :' ), 'PS_IT_OF_CP_CITY' => array( 'form_cp_city', 'CP et Ville :' ), 'PS_IT_OF_NUMBER_PHONE' => array( 'form_numero_tel', 'Numéro de téléphone :' ), 'PS_IT_OF_BAS_PAGE' => array( 'form_bas_page', 'Informations bas de page :', true ), 'PS_IT_OF_BAS_PAGE_BIS' => array( 'form_bas_page_bis', 'Informations bas de page Bis:', true ), ); if(Tools::isSubmit('submitFormInfos')) { foreach($array_lang as $lang) { foreach($array as $k => $arr) { if(isset($arr[2])) $html_ = true; else $html_ = false; Configuration::updateValue($k.'_'.$lang, Tools::getValue($arr[0].'_'.$lang), $html_); } } Configuration::updateValue('PS_IT_OF_ORDER_STATES', implode(',', Tools::getValue('states', array() )) ); $html .= '