Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Adjust displaying mega nav with subcategories (#12488)

Łukasz Adamczyk265a87c0aba3
diff --git a/storefront/app/presenters/spree/mega_nav_presenter.rb b/storefront/app/presenters/spree/mega_nav_presenter.rb
index 42b35b83f3..13e229f47c 100644
--- a/storefront/app/presenters/spree/mega_nav_presenter.rb
+++ b/storefront/app/presenters/spree/mega_nav_presenter.rb
@@ -23,7 +23,7 @@ module Spree
main_subcategories.first(max_columns).map do |child_category|
links = subcategories.find_all { |c| c.parent_id == child_category.id }.sort_by(&:position).map(&method(:to_link))
- ColumnPresenter.new(title: child_category.name, links: links, view_all_linkable: child_category) if links.any?
+ ColumnPresenter.new(title: child_category.name, links: links, view_all_linkable: child_category)
end.compact_blank
elsif mega_nav.is_a?(Spree::PageBlocks::MegaNav)
[ColumnPresenter.new(title: main_link.label, links: mega_nav.links.drop(1), view_all_linkable: main_link.linkable)]