From 6b8b3be5241649f30eb2b9c5ae23afd72c85f1e4 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Wed, 11 Mar 2020 15:59:07 +1100 Subject: [PATCH] Show "Back To Store" button when no shop has been selected yet --- app/views/spree/orders/form/_update_buttons.html.haml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/spree/orders/form/_update_buttons.html.haml b/app/views/spree/orders/form/_update_buttons.html.haml index 3a64a79a43..22ede28e57 100644 --- a/app/views/spree/orders/form/_update_buttons.html.haml +++ b/app/views/spree/orders/form/_update_buttons.html.haml @@ -1,12 +1,12 @@ .row .columns.small-12.medium-3 - - if current_order.andand.distributor == @order.distributor - - if current_order.line_items.present? + - if current_order.nil? || current_order.distributor.nil? || current_order.distributor == @order.distributor + - if current_order&.line_items.present? = link_to main_app.cart_path, :class => "button expand" do %i.ofn-i_008-caret-left = t(:order_back_to_cart) - else - = link_to current_shop_products_path, :class => "button expand" do + = link_to "#{main_app.enterprise_shop_path(@order.distributor)}#/shop", class: "button expand" do %i.ofn-i_008-caret-left = t(:order_back_to_store) - else