How can i create categories with same name under difference parent?

  • Posts: 79
  • Thank you received: 0
8 years 4 months ago #259252

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

Please Log in or Create an account to join the conversation.

  • Posts: 26249
  • Thank you received: 4039
  • MODERATOR
8 years 4 months ago #259254

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,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 79
  • Thank you received: 0
8 years 4 months ago #259398

hi , thanks for the reply.
but as you can see in attached screenshot, there is no field for me to fill up alias when i create categories? but if i create a category with a category name that oledi exist, error message in the image shows up.
or there is something i missed up on alias part?


Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 83927
  • Thank you received: 13584
  • MODERATOR
8 years 4 months ago #259423

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.

Please Log in or Create an account to join the conversation.

Time to create page: 0.083 seconds
Powered by Kunena Forum