- Posts: 79
- Thank you received: 0
How can i create categories with same name under difference parent?
9 years 8 months ago #259252
by waisign
Hi, due to client requirement i needed to create categories with same name under difference parent but hikashop not allowed me to do so cause of the alias.
Is there any way i can create categories with same name? below is example i would like to do
Parent1
| Category Name1
Parent2
| Category Name1
Is there any way i can create categories with same name? below is example i would like to do
Parent1
| Category Name1
Parent2
| Category Name1
Please Log in or Create an account to join the conversation.
9 years 8 months ago #259254
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic How can i create categories with same name under difference parent?
Hi,
An alias is unique so you can't have two categories with the same alias.
But the name is not the alias ; so you can have two categories with the same name, as long as they don't have the same alias.
Regards,
An alias is unique so you can't have two categories with the same alias.
But the name is not the alias ; so you can have two categories with the same name, as long as they don't have the same alias.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
9 years 8 months ago #259398
by waisign
Replied by waisign on topic How can i create categories with same name under difference parent?
Please Log in or Create an account to join the conversation.
9 years 8 months ago #259423
by nicolas
Replied by nicolas on topic How can i create categories with same name under difference parent?
Hi,
Here is the default interface when you edit a category in HikaShop:
take.ms/tgpBB
You can see it on our demo website:
demo.hikashop.com/administrator/index.ph...tegory&task=edit&cid []=12
As you can see, there is an alias field in the interface.
So that means that the type of your category is neither a "brand" not a "product category" but a tax category or an order status, or an unknown category type. So you must have been messing with the categories at some point which lead to that problem.
Change the line:
if(!empty($element->category_alias)) {
to:
if(!empty($element->category_alias) && (empty($element->category_type) || in_array($element->category_type,array('product','manufacturer')))) {
in the file administrator/components/com_hikashop/classes/category.php so that the check is really only done when needed and that will prevent you from seeing the error.
However, the category type of your category will still be wrong so you might have issues in the frontend when using it.
I would recommend to go in your PHPMyAdmin and check that the category correctly has the value "product" in the column "category_type" in the table hikashop_category.
Here is the default interface when you edit a category in HikaShop:
take.ms/tgpBB
You can see it on our demo website:
demo.hikashop.com/administrator/index.ph...tegory&task=edit&cid []=12
As you can see, there is an alias field in the interface.
So that means that the type of your category is neither a "brand" not a "product category" but a tax category or an order status, or an unknown category type. So you must have been messing with the categories at some point which lead to that problem.
Change the line:
if(!empty($element->category_alias)) {
to:
if(!empty($element->category_alias) && (empty($element->category_type) || in_array($element->category_type,array('product','manufacturer')))) {
in the file administrator/components/com_hikashop/classes/category.php so that the check is really only done when needed and that will prevent you from seeing the error.
However, the category type of your category will still be wrong so you might have issues in the frontend when using it.
I would recommend to go in your PHPMyAdmin and check that the category correctly has the value "product" in the column "category_type" in the table hikashop_category.
Please Log in or Create an account to join the conversation.
Time to create page: 0.144 seconds