Hide "Take me shopping" button on /shop and /shops pages

This commit is contained in:
Matt-Yorkley
2020-05-23 12:48:58 +02:00
parent 387a5ec950
commit 2bcadd52e8
2 changed files with 10 additions and 1 deletions

View File

@@ -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

View File

@@ -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"}