Show Empty Categories on Catalog Page - Magento 2How 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
What happens when a metallic dragon and a chromatic dragon mate?
Unbreakable Formation vs. Cry of the Carnarium
How can I fix this gap between bookcases I made?
Manga about a female worker who got dragged into another world together with this high school girl and she was just told she's not needed anymore
Is domain driven design an anti-SQL pattern?
Is Social Media Science Fiction?
Re-submission of rejected manuscript without informing co-authors
Does the average primeness of natural numbers tend to zero?
Does it makes sense to buy a new cycle to learn riding?
What causes the sudden spool-up sound from an F-16 when enabling afterburner?
Pristine Bit Checking
Why do UK politicians seemingly ignore opinion polls on Brexit?
Was there ever an axiom rendered a theorem?
Where to refill my bottle in India?
"listening to me about as much as you're listening to this pole here"
How did the USSR manage to innovate in an environment characterized by government censorship and high bureaucracy?
Uplifted animals have parts of their "brain" in various locations of their body. Where?
aging parents with no investments
Why do we use polarized capacitors?
Denied boarding due to overcrowding, Sparpreis ticket. What are my rights?
What is it called when one voice type sings a 'solo'?
Landing in very high winds
Is "plugging out" electronic devices an American expression?
Is this relativistic mass?
Show Empty Categories on Catalog Page - Magento 2
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;
I want to show all categories, even if they have no products in them.
How can I achieve something like this?
magento2 catalog cataloginventory
bumped to the homepage by Community♦ 1 hour ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I want to show all categories, even if they have no products in them.
How can I achieve something like this?
magento2 catalog cataloginventory
bumped to the homepage by Community♦ 1 hour ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I want to show all categories, even if they have no products in them.
How can I achieve something like this?
magento2 catalog cataloginventory
I want to show all categories, even if they have no products in them.
How can I achieve something like this?
magento2 catalog cataloginventory
magento2 catalog cataloginventory
asked Dec 16 '16 at 17:04
CamCam
1385
1385
bumped to the homepage by Community♦ 1 hour ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 1 hour ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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!
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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!
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
add a comment |
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!
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
add a comment |
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!
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!
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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