Merge pull request #830 from indesign47/patch-5

[-] MO : productcomments errors translated in multi-language
This commit is contained in:
fchellypresta
2013-10-11 00:40:32 -07:00
@@ -73,21 +73,21 @@ class ProductCommentsDefaultModuleFrontController extends ModuleFrontController
$errors = array(); $errors = array();
// Validation // Validation
if (!Validate::isInt(Tools::getValue('id_product'))) if (!Validate::isInt(Tools::getValue('id_product')))
$errors[] = $module_instance->l('ID product is incorrect'); $errors[] = $module_instance->l('ID product is incorrect', 'default');
if (!Tools::getValue('title') || !Validate::isGenericName(Tools::getValue('title'))) if (!Tools::getValue('title') || !Validate::isGenericName(Tools::getValue('title')))
$errors[] = $module_instance->l('Title is incorrect'); $errors[] = $module_instance->l('Title is incorrect', 'default');
if (!Tools::getValue('content') || !Validate::isMessage(Tools::getValue('content'))) if (!Tools::getValue('content') || !Validate::isMessage(Tools::getValue('content')))
$errors[] = $module_instance->l('Comment is incorrect'); $errors[] = $module_instance->l('Comment is incorrect', 'default');
if (!$id_customer && (!Tools::isSubmit('customer_name') || !Tools::getValue('customer_name') || !Validate::isGenericName(Tools::getValue('customer_name')))) if (!$id_customer && (!Tools::isSubmit('customer_name') || !Tools::getValue('customer_name') || !Validate::isGenericName(Tools::getValue('customer_name'))))
$errors[] = $module_instance->l('Customer name is incorrect'); $errors[] = $module_instance->l('Customer name is incorrect', 'default');
if (!$this->context->customer->id && !Configuration::get('PRODUCT_COMMENTS_ALLOW_GUESTS')) if (!$this->context->customer->id && !Configuration::get('PRODUCT_COMMENTS_ALLOW_GUESTS'))
$errors[] = $module_instance->l('You must be logged in order to send a comment'); $errors[] = $module_instance->l('You must be logged in order to send a comment', 'default');
if (!count(Tools::getValue('criterion'))) if (!count(Tools::getValue('criterion')))
$errors[] = $module_instance->l('You must give a rating'); $errors[] = $module_instance->l('You must give a rating', 'default');
$product = new Product(Tools::getValue('id_product')); $product = new Product(Tools::getValue('id_product'));
if (!$product->id) if (!$product->id)
$errors[] = $module_instance->l('Product not found'); $errors[] = $module_instance->l('Product not found', 'default');
if (!count($errors)) if (!count($errors))
{ {