mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-14 04:04:23 +00:00
add selector for distributor in checkout. Not saving relation as yet.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
module Spree
|
||||
class Distributor < ActiveRecord::Base
|
||||
set_table_name 'distributors'
|
||||
|
||||
validates :name, :pickup_address, :presence => true
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Deface::Override.new(:virtual_path => "spree/checkout/_delivery",
|
||||
:insert_before => "[data-hook='buttons']",
|
||||
:text => "<p>TODO: Select a drop off point.... </p>",
|
||||
Deface::Override.new(:virtual_path => "spree/checkout/_address",
|
||||
:replace => "[data-hook='shipping_fieldset_wrapper']",
|
||||
:partial => "spree/checkout/distributor",
|
||||
:name => "drop_off_point")
|
||||
4
app/views/spree/checkout/_distributor.html.haml
Normal file
4
app/views/spree/checkout/_distributor.html.haml
Normal file
@@ -0,0 +1,4 @@
|
||||
.columns.omega.six
|
||||
%fieldset{:id => 'shipping'}
|
||||
%legend Collection Point
|
||||
=select("distributor", "distributor_id", Spree::Distributor.all.collect {|p| [ p.name , p.id] },)
|
||||
Reference in New Issue
Block a user