1

I want to have Category navigation - so instead of going to the product pages user can navigate using the category images and subcategories shown in a grid and also shows the left navigation on same page and then get to the product listing

I have read some posts here and there is also a module however i don't know how to install and use it on our custom theme.

This is link to the module :

https://github.com/pratikmage/magento2-subcategory

I have looked for guides but there are mostly for Magento 1

It's a very common requirement on any eCommerce site and all have it. Also i need this to be loading automatically as we have hundreds of categories and subcategories.

1

Try this !!

1) Download the Code from https://github.com/pratikmage/magento2-subcategory and place this folder in app/code/local/Company/Categorylist/..

2) Go to root folder var/cache/ remove all folders under it. OR Go to admin dashboard system->Cache Management- Select all -> Click on Flush Magento Cache.

3) Now go to System -> Configuration search for Company you will find the plugin enable the extension and Do the Step 2 again.

4) Now create CMS Page from CMS -> Page -> Add new -> Place the following code

{{block class="Magento\Catalog\Block\Category\View" name="subcat" template="category/sub.phtml"}}

in Content Box. Now go to Front end and access this Page you will Category view. This Process is to Installing this module and accessing it. If you wanted to Do it in Product listing page Follow this link

Here block_identifier is the CMS Static block's Unique identifier.

To Place this PHTML file you have to Create static block -> Create static block same as CMS Page But for static block you will be having block_identifier.

  • Thank you very much raghav for your kind and detailed reply - really appreciate it, i will try these steps and update here. if you can clarify on some things 1. when adding this block class {{block class="Magento\Catalog\Block\Category\View" name="subcat" template="category/sub.phtml"}} would this be applicable for all installs or if i am using a custom theme do i need to put path to my magento 2 folder? – jt9489 Oct 20 '17 at 17:34
  • I tried to do step 1 as there was no app/code/local/ for me i created myself and loaded files to here. /home/myhome/public_html/24mag2topshop/app/code/local/Company/Categorylist i cleared cache from admin and also var/cache folder however when checking in Stores - Configuration i can not see Company or Categorylist anywhere. I then to put in same place where the other extensions the theme uses /home/myhome/public_html/24mag2topshop/app/code/Sm cleared the cache and tried to look for it but again can not find it in admin. what am i doing wrong – jt9489 Oct 20 '17 at 18:24
  • hi to update - the module seems to have been installed and enabled i followed rest of the steps but when i access the page all if get is This page isn’t working is currently unable to handle this request. HTTP ERROR 500 – jt9489 Oct 21 '17 at 11:37
  • Hi @jt9489 . Try to Uncomment #Mage::setIsDeveloperMode(true); #ini_set(‘display_errors’, 1); these two lines from your index.php (Root Folder). You may find the issue which leads to the Internal Error Server. – Raghav Oct 23 '17 at 6:40
  • Hello Ragav thank you for your kind reply, i have checked the file you mentioned but in mine these lines are not there im trying to add the code here but too long – jt9489 Oct 23 '17 at 8:43

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.