mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Hide "Take me shopping" button on /shop and /shops pages
This commit is contained in:
@@ -50,4 +50,13 @@ module ShopHelper
|
||||
def no_open_order_cycles?
|
||||
@no_open_order_cycles ||= @order_cycles&.empty?
|
||||
end
|
||||
|
||||
def show_shopping_cta?
|
||||
return false if current_page?(main_app.shops_path)
|
||||
|
||||
return false if current_distributor.present? &&
|
||||
current_page?(main_app.enterprise_shop_path(current_distributor))
|
||||
|
||||
true
|
||||
end
|
||||
end
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
%p
|
||||
= t('.cart_empty')
|
||||
|
||||
%a.go-shopping.button.large.bright{ng: {href: "{{ CurrentHub.hub.id ? '#{main_app.shop_path}' : '#{main_app.shops_path}' }}"}}
|
||||
%a.go-shopping.button.large.bright{ng: {show: "#{show_shopping_cta?}", href: "{{ CurrentHub.hub.id ? '#{main_app.shop_path}' : '#{main_app.shops_path}' }}"}}
|
||||
= t('.take_me_shopping')
|
||||
|
||||
.sidebar-footer{"ng-show" => "Cart.line_items.length > 0"}
|
||||
|
||||
Reference in New Issue
Block a user