
Petite question du jour : Comment afficher un message d’erreur dans le BO Prestashop quand on fait un module “Admin” ?
Tout simplement en fait 🙂
public function hookAdminOrder($params)
{
$order = new Order($params['id_order']);
$weight = floatval(Tools::getValue('shipment_weight'));
if(!$weight){
$this->context->controller->errors[] = $this->l('Weight is not set');
}
[...]
}
Voilà, vous savez tout ^^
PS: ça marche aussi pour warnings