Hi,
Add the code:
if(!empty($product->product_alias)){
$query = 'SELECT product_id FROM '.hikashop_table('product').' WHERE product_alias='.$this->db->Quote($product->product_alias);
$this->db->setQuery($query);
$product_with_same_alias = $this->db->loadResult();
if($product_with_same_alias && (empty($product->product_id) || $product_with_same_alias!=$product->product_id)){
$app->enqueueMessage(JText::_( 'ELEMENT_WITH_SAME_ALIAS_ALREADY_EXISTS' ), 'error');
JRequest::setVar( 'fail', $product );
return false;
}
}
after the code:
if($config->get('alias_auto_fill', 1) && empty($product->product_alias) && !empty($product->product_name)) {
$this->addAlias($product);
// add a letter at the beginning of the alias to avoid issues when the alias of a product starts with a number
if($config->get('sef_remove_id', 0) && (int)$product->alias > 0)
$product->alias = $config->get('alias_prefix', 'p') . $product->alias;
$product->product_alias = $product->alias;
unset($product->alias);
}
in the file administrator/components/com_hikashop/classes/product.php and that will do it.