Show Empty Categories on Catalog Page - Magento 2 The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)How to link between two categories in different root catalog?Assigning Products to Catalog CategoriesShow only parent categories and sub-categories in left navMagento 2 categories importImported Products Not In Catalog --> Manage ProductsMagento 2 : How to Create Product Attribute With All Active Categories DropDownMagento 2 : How to Show All Active Categories in Layered Navigation With Its Sub-categories?Show star rating on Catalog list page Magento 2How to hide the categories which has no product from topmenu in Magento2Show secondary categories in layered navigation

Is this wall load bearing? Blueprints and photos attached

Nested ellipses in tikzpicture: Chomsky hierarchy

Identify 80s or 90s comics with ripped creatures (not dwarves)

Simulating Exploding Dice

What other Star Trek series did the main TNG cast show up in?

How many cones with angle theta can I pack into the unit sphere?

What to do when moving next to a bird sanctuary with a loosely-domesticated cat?

Solving overdetermined system by QR decomposition

Deal with toxic manager when you can't quit

How do you keep chess fun when your opponent constantly beats you?

Did the new image of black hole confirm the general theory of relativity?

number sequence puzzle deep six

Variable with quotation marks "$()"

Didn't get enough time to take a Coding Test - what to do now?

What happens to a Warlock's expended Spell Slots when they gain a Level?

Accepted by European university, rejected by all American ones I applied to? Possible reasons?

Do working physicists consider Newtonian mechanics to be "falsified"?

Voltage transmission

For what reasons would an animal species NOT cross a *horizontal* land bridge?

Make it rain characters

What can I do if neighbor is blocking my solar panels intentionally?

How to determine omitted units in a publication

Is every episode of "Where are my Pants?" identical?

Are spiders unable to hurt humans, especially very small spiders?



Show Empty Categories on Catalog Page - Magento 2



The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)How to link between two categories in different root catalog?Assigning Products to Catalog CategoriesShow only parent categories and sub-categories in left navMagento 2 categories importImported Products Not In Catalog --> Manage ProductsMagento 2 : How to Create Product Attribute With All Active Categories DropDownMagento 2 : How to Show All Active Categories in Layered Navigation With Its Sub-categories?Show star rating on Catalog list page Magento 2How to hide the categories which has no product from topmenu in Magento2Show secondary categories in layered navigation



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I want to show all categories, even if they have no products in them.



How can I achieve something like this?



Empty Category Example










share|improve this question




























    0















    I want to show all categories, even if they have no products in them.



    How can I achieve something like this?



    Empty Category Example










    share|improve this question
























      0












      0








      0








      I want to show all categories, even if they have no products in them.



      How can I achieve something like this?



      Empty Category Example










      share|improve this question














      I want to show all categories, even if they have no products in them.



      How can I achieve something like this?



      Empty Category Example







      magento2 catalog cataloginventory






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 16 '16 at 17:04









      CamCam

      1385




      1385




















          1 Answer
          1






          active

          oldest

          votes


















          0














          I believe that you'll need to override the Magento/LayeredNavigation/view/frontend/templates/layer/view.phtml template. Here is the relevant code:



          <?php foreach ($block->getFilters() as $filter): ?>
          <?php if (!$wrapOptions): ?>
          <strong role="heading" aria-level="2" class="block-subtitle filter-subtitle"><?php /* @escapeNotVerified */ echo __('Shopping Options') ?></strong>
          <dl class="filter-options" id="narrow-by-list">
          <?php $wrapOptions = true; endif; ?>
          <?php if ($filter->getItemsCount()): ?>
          <dt role="heading" aria-level="3" class="filter-options-title"><?php echo $block->escapeHtml(__($filter->getName())) ?></dt>
          <dd class="filter-options-content"><?php /* @escapeNotVerified */ echo $block->getChildBlock('renderer')->render($filter); ?></dd>
          <?php endif; ?>
          <?php endforeach; ?>


          I believe that this line is what you will want to remove: <?php if ($filter->getItemsCount(): ?>. Obviously, override the core file, don't edit it directly.



          If you have any questions, please let me know!






          share|improve this answer























          • All that does is remove the entire "category type" from the block. I want the category children that are 0 to be visible.

            – Cam
            Dec 17 '16 at 14:33












          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "479"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f150707%2fshow-empty-categories-on-catalog-page-magento-2%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          I believe that you'll need to override the Magento/LayeredNavigation/view/frontend/templates/layer/view.phtml template. Here is the relevant code:



          <?php foreach ($block->getFilters() as $filter): ?>
          <?php if (!$wrapOptions): ?>
          <strong role="heading" aria-level="2" class="block-subtitle filter-subtitle"><?php /* @escapeNotVerified */ echo __('Shopping Options') ?></strong>
          <dl class="filter-options" id="narrow-by-list">
          <?php $wrapOptions = true; endif; ?>
          <?php if ($filter->getItemsCount()): ?>
          <dt role="heading" aria-level="3" class="filter-options-title"><?php echo $block->escapeHtml(__($filter->getName())) ?></dt>
          <dd class="filter-options-content"><?php /* @escapeNotVerified */ echo $block->getChildBlock('renderer')->render($filter); ?></dd>
          <?php endif; ?>
          <?php endforeach; ?>


          I believe that this line is what you will want to remove: <?php if ($filter->getItemsCount(): ?>. Obviously, override the core file, don't edit it directly.



          If you have any questions, please let me know!






          share|improve this answer























          • All that does is remove the entire "category type" from the block. I want the category children that are 0 to be visible.

            – Cam
            Dec 17 '16 at 14:33
















          0














          I believe that you'll need to override the Magento/LayeredNavigation/view/frontend/templates/layer/view.phtml template. Here is the relevant code:



          <?php foreach ($block->getFilters() as $filter): ?>
          <?php if (!$wrapOptions): ?>
          <strong role="heading" aria-level="2" class="block-subtitle filter-subtitle"><?php /* @escapeNotVerified */ echo __('Shopping Options') ?></strong>
          <dl class="filter-options" id="narrow-by-list">
          <?php $wrapOptions = true; endif; ?>
          <?php if ($filter->getItemsCount()): ?>
          <dt role="heading" aria-level="3" class="filter-options-title"><?php echo $block->escapeHtml(__($filter->getName())) ?></dt>
          <dd class="filter-options-content"><?php /* @escapeNotVerified */ echo $block->getChildBlock('renderer')->render($filter); ?></dd>
          <?php endif; ?>
          <?php endforeach; ?>


          I believe that this line is what you will want to remove: <?php if ($filter->getItemsCount(): ?>. Obviously, override the core file, don't edit it directly.



          If you have any questions, please let me know!






          share|improve this answer























          • All that does is remove the entire "category type" from the block. I want the category children that are 0 to be visible.

            – Cam
            Dec 17 '16 at 14:33














          0












          0








          0







          I believe that you'll need to override the Magento/LayeredNavigation/view/frontend/templates/layer/view.phtml template. Here is the relevant code:



          <?php foreach ($block->getFilters() as $filter): ?>
          <?php if (!$wrapOptions): ?>
          <strong role="heading" aria-level="2" class="block-subtitle filter-subtitle"><?php /* @escapeNotVerified */ echo __('Shopping Options') ?></strong>
          <dl class="filter-options" id="narrow-by-list">
          <?php $wrapOptions = true; endif; ?>
          <?php if ($filter->getItemsCount()): ?>
          <dt role="heading" aria-level="3" class="filter-options-title"><?php echo $block->escapeHtml(__($filter->getName())) ?></dt>
          <dd class="filter-options-content"><?php /* @escapeNotVerified */ echo $block->getChildBlock('renderer')->render($filter); ?></dd>
          <?php endif; ?>
          <?php endforeach; ?>


          I believe that this line is what you will want to remove: <?php if ($filter->getItemsCount(): ?>. Obviously, override the core file, don't edit it directly.



          If you have any questions, please let me know!






          share|improve this answer













          I believe that you'll need to override the Magento/LayeredNavigation/view/frontend/templates/layer/view.phtml template. Here is the relevant code:



          <?php foreach ($block->getFilters() as $filter): ?>
          <?php if (!$wrapOptions): ?>
          <strong role="heading" aria-level="2" class="block-subtitle filter-subtitle"><?php /* @escapeNotVerified */ echo __('Shopping Options') ?></strong>
          <dl class="filter-options" id="narrow-by-list">
          <?php $wrapOptions = true; endif; ?>
          <?php if ($filter->getItemsCount()): ?>
          <dt role="heading" aria-level="3" class="filter-options-title"><?php echo $block->escapeHtml(__($filter->getName())) ?></dt>
          <dd class="filter-options-content"><?php /* @escapeNotVerified */ echo $block->getChildBlock('renderer')->render($filter); ?></dd>
          <?php endif; ?>
          <?php endforeach; ?>


          I believe that this line is what you will want to remove: <?php if ($filter->getItemsCount(): ?>. Obviously, override the core file, don't edit it directly.



          If you have any questions, please let me know!







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Dec 17 '16 at 4:34









          tjonstjons

          1,756717




          1,756717












          • All that does is remove the entire "category type" from the block. I want the category children that are 0 to be visible.

            – Cam
            Dec 17 '16 at 14:33


















          • All that does is remove the entire "category type" from the block. I want the category children that are 0 to be visible.

            – Cam
            Dec 17 '16 at 14:33

















          All that does is remove the entire "category type" from the block. I want the category children that are 0 to be visible.

          – Cam
          Dec 17 '16 at 14:33






          All that does is remove the entire "category type" from the block. I want the category children that are 0 to be visible.

          – Cam
          Dec 17 '16 at 14:33


















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Magento Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f150707%2fshow-empty-categories-on-catalog-page-magento-2%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Bulk add to cart function issuecart vs. mini cart issue … rwd themeRedirect Add to cart button to cart pageAdd to cart issue - Magento 2.1The requested Payment Method is not available When creating an orderM2: reason add-to-cart might not function in production modeAdd to cart issue in some android devicesMagento 2 - custom price can not add to subtotal and grand total after add to cartAdd to cart codeIssue with my cart module on pdp and cart pages, just keeps spinningBulk price and quantity update using rest api

          Magento2 - How to hide price filter only in specific categories?Multiselect price filter attribute in layered navigationhide only some categories from layered navigation in magentoRemove Price Filter on certain categoriescustomize layered price filter?Hide Price for a particular customer groupPrice filter in layered navigation not working correctly with price including tax in magento 2.2.3Magento 2 how to hide attribute at Layered navigation?Magento 2. how to hide price only for specific categoriesMagento 2 How can I hide the price and total from cart and checkout summary?Magento2: Can we add navigation layered filter like price filter for other attribute?