mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Display an explanation message on product page when no distributor is selected
This commit is contained in:
@@ -144,6 +144,16 @@ ul.product-listing {
|
||||
}
|
||||
|
||||
|
||||
/* Distributor details on product details page */
|
||||
#product-distributor-details {
|
||||
float: right;
|
||||
}
|
||||
|
||||
#product-variants {
|
||||
float: none;
|
||||
}
|
||||
|
||||
|
||||
/* Add to cart form on product details page */
|
||||
#cart-form {
|
||||
.error-distributor {
|
||||
|
||||
4
app/overrides/add_distributor_details_to_product.rb
Normal file
4
app/overrides/add_distributor_details_to_product.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
Deface::Override.new(:virtual_path => "spree/products/show",
|
||||
:insert_before => "[data-hook='cart_form']",
|
||||
:partial => "distributors/details",
|
||||
:name => "product_distributor_details")
|
||||
2
app/views/distributors/_details.html.haml
Normal file
2
app/views/distributors/_details.html.haml
Normal file
@@ -0,0 +1,2 @@
|
||||
#product-distributor-details.columns.five.omega
|
||||
When you select a distributor for your order, their address and pickup times will be displayed here.
|
||||
@@ -22,4 +22,23 @@ feature %q{
|
||||
page.should have_selector 'td', :text => d.name
|
||||
end
|
||||
|
||||
describe "viewing distributor details" do
|
||||
context "without Javascript" do
|
||||
it "displays a holding message when no distributor is selected" do
|
||||
p = create(:product)
|
||||
|
||||
visit spree.product_path p
|
||||
|
||||
page.should have_selector '#product-distributor-details', :text => 'When you select a distributor for your order, their address and pickup times will be displayed here.'
|
||||
end
|
||||
|
||||
it "displays distributor details when one is selected"
|
||||
end
|
||||
|
||||
context "with Javascript" do
|
||||
it "changes distributor details when the distributor is changed"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user