Merge pull request #3932 from luisramos0/shpfront_message

Improve message in private shopfront when user is not logged in or not a customer
This commit is contained in:
Luis Ramos
2019-06-26 15:31:06 +01:00
committed by GitHub
3 changed files with 11 additions and 10 deletions

View File

@@ -7,7 +7,9 @@
- if spree_current_user.nil?
= t '.require_login_html',
{login: ('<a auth="login">' + t('.login') + '</a>').html_safe,
register: ('<a auth="signup">' + t('.register') + '</a>').html_safe}
signup: ('<a auth="signup">' + t('.signup') + '</a>').html_safe,
contact: link_to(t('.contact'), '#contact'),
enterprise: current_distributor.name}
- else
= t '.require_customer_html',
{contact: link_to(t('.contact'), '#contact'),

View File

@@ -1172,12 +1172,11 @@ en:
shop:
messages:
login: "login"
register: "register"
signup: "signup"
contact: "contact"
require_customer_login: "This shop is for customers only."
require_login_html: "Please %{login} if you have an account already. Otherwise, %{register} to become a customer."
require_customer_html: "Please %{contact} %{enterprise} to become a customer."
require_customer_login: "Only approved customers can access this shop."
require_login_html: "If you're already an approved customer, %{login} or %{signup} to proceed. Want to start shopping here? Please %{contact} %{enterprise} and ask about joining."
require_customer_html: "If you'd like to start shopping here, please %{contact} %{enterprise} to ask about joining."
# Front-end controller translations
card_could_not_be_updated: Card could not be updated

View File

@@ -462,8 +462,8 @@ feature "As a consumer I want to shop with a distributor", js: true do
context "when not logged in" do
it "tells us to login" do
visit shop_path
expect(page).to have_content "This shop is for customers only."
expect(page).to have_content "Please login"
expect(page).to have_content "Only approved customers can access this shop."
expect(page).to have_content "login or signup"
expect(page).to have_no_content product.name
end
end
@@ -479,8 +479,8 @@ feature "As a consumer I want to shop with a distributor", js: true do
context "as non-customer" do
it "tells us to contact enterprise" do
visit shop_path
expect(page).to have_content "This shop is for customers only."
expect(page).to have_content "Please contact #{distributor.name}"
expect(page).to have_content "Only approved customers can access this shop."
expect(page).to have_content "please contact #{distributor.name}"
expect(page).to have_no_content product.name
end
end