1

I'm using magento 2, and I'm building my main navigation by creating the product categories.

I need to have CLOTHING as category and DRESSES as subcategory for CLOTHING , but I also need to have DRESSES next to CLOTHING , as it would be a category , even if is not.. and I want to have same target for both of them.

My question is , do I have to create DRESSES twice ? once as subcategory and once as category , or there is any way to just print the link with his eventually other subcategories ?

1

Unfortunately, there's no out of the box functionality to achieve what you want.

My hacky suggestion:

  • create the clothing > dresses subcategory first. This will be the category where all your dresses products go. Take note of the category id.
  • create the dresses category.
  • now go to Marketing > URL Rewrites
  • the most recent entry should your new category and look like this: request path: url-key.html / target path: catalog/category/view/id/<id_of_your_dresses_category>
  • click the Add URL Rewrite button
  • under Create URL Rewrite dropdown, ensure you select Custom
  • now you can fill the form like this:
  • Request path: catalog/category/view/id/<id_of_your_dresses_category>
  • Target path: catalog/category/view/id/<id_of_your_dresses_subcategory>
  • Redirect type: Permanent
  • Then hit the Save button.
  • I did as you sayd , but when I hit dresses it still goes to the category , and not to CLOTHING - DRESSES , and also the DRESSES menu doesn't drop down the subcategories that CLOTHING - DRESSES - have.. I have reindexed and cleared the cache.. – alexcr May 12 '16 at 14:32
  • Hi @Raphael at Digital Pianism , can you please give me a help with this , I did as you said , but still not targeting.. any suggestion ? – alexcr May 16 '16 at 8:43
  • @alexcr I'll make more tests tomorrow and let you know – Raphael at Digital Pianism May 16 '16 at 10:46
  • ok @Raphael at Digital Pianism , here is an example pretty much of what I'm trying to do with the menu.. lasula.com thank you for your time ! – alexcr May 16 '16 at 11:15
  • 1
    actually it works , is just that you need to delete the old one , cause there must be 2 rewrites , one that get's automaticly created when you create the category , and the second one I've created to redirect it.. so once I've created the second one , I had to delete the first one.. so now is actually redirecting where I want.. is that the most correct way to do it ? – alexcr May 17 '16 at 9:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.