$product) {
if (Validate::isLoadedObject($product = new Product((int)$product))) {
// foreach ($languages as $key => $language) {
// if(isset($title[$product->id])){
// $product->name[$language['id_lang']] = $title[$product->id];
// }
// if(isset($short_description[$product->id])){
// $product->description_short[$language['id_lang']] = $short_description[$product->id];
// }
// if(isset($description[$product->id])){
// $product->description[$language['id_lang']] = $description[$product->id];
// }
// }
if (isset($title[$product->id])) {
$product->name[(int) $id_lang_fast] = $title[$product->id];
}
if (isset($short_description[$product->id])) {
$product->description_short[(int) $id_lang_fast] = $short_description[$product->id];
}
if(isset($description[$product->id])){
$product->description[(int) $id_lang_fast] = $description[$product->id];
}
if(isset($description_more[$product->id])){
$product->description_more[(int) $id_lang_fast] = $description_more[$product->id];
}
if(isset($description_comment[$product->id])){
$product->description_comment[(int) $id_lang_fast] = $description_comment[$product->id];
}
if(isset($description_delivery[$product->id])){
$product->description_delivery[(int) $id_lang_fast] = $description_delivery[$product->id];
}
if(isset($videos[$product->id])){
$product->videos[(int) $id_lang_fast] = $videos[$product->id];
}
if(isset($reference[$product->id])){
$product->reference = $reference[$product->id];
}
if ($product->save()) {
$nbProduct++;
} else {
$this->_html .= $product . " erreur";
}
} else {
$this->_html .= $product . " erreur";
}
}
$this->_html .= '
'. $nbProduct. ' produit(s) mis à jour avec succès
';
}
}
public function display()
{
global $cookie;
$id_lang = Tools::getValue('id_lang_fast', $cookie->id_lang);
$language = new Language($id_lang);
$default_blocks = array(
'short_description',
'description',
'description_more',
'description_comment',
'description_delivery',
'videos'
);
if (Tools::getIsset('id_product')) {
$this->_html .= 'Edition rapide - '.$language->name.'
';
$this->_html .= '';
}else{
$this->_html .= "Vous devez choisir des produits dans l'onglet Catalogue
";
}
// TinyMCE
global $cookie;
$iso = Language::getIsoById((int)($cookie->id_lang));
$isoTinyMCE = (file_exists(_PS_ROOT_DIR_.'/js/tiny_mce/langs/'.$iso.'.js') ? $iso : 'en');
$ad = dirname($_SERVER["PHP_SELF"]);
echo '
';
echo $this->_html;
}
public function displayFormProduct(Product $product, $blocks = array()) {
$form = '';
$form .= ''. $product->name .'
';
$form .= '';
$form .= '
';
$form .= '';
return $form;
}
}