Commit 921c10e32e9940b731b538ff086277f55767a582

Authored by Rodrigo Souto
1 parent 882b9f2c

Shopping checkout interface

* Missing the send-email implementation
plugins/shopping_cart/controllers/shopping_cart_plugin_profile_controller.rb
@@ -2,7 +2,6 @@ include ShoppingCartPlugin::CartHelper @@ -2,7 +2,6 @@ include ShoppingCartPlugin::CartHelper
2 2
3 class ShoppingCartPluginProfileController < ProfileController 3 class ShoppingCartPluginProfileController < ProfileController
4 append_view_path File.join(File.dirname(__FILE__) + '/../views') 4 append_view_path File.join(File.dirname(__FILE__) + '/../views')
5 -  
6 before_filter :login_required, :only => [] 5 before_filter :login_required, :only => []
7 6
8 def add 7 def add
@@ -114,9 +113,9 @@ class ShoppingCartPluginProfileController &lt; ProfileController @@ -114,9 +113,9 @@ class ShoppingCartPluginProfileController &lt; ProfileController
114 render :text => { 113 render :text => {
115 :ok => false, 114 :ok => false,
116 :error => { 115 :error => {
117 - :code => 1,  
118 - :message => _("Can't join items from different enterprises.")  
119 - } 116 + :code => 1,
  117 + :message => _("Can't join items from different enterprises.")
  118 + }
120 }.to_json 119 }.to_json
121 return false 120 return false
122 end 121 end
@@ -128,9 +127,9 @@ class ShoppingCartPluginProfileController &lt; ProfileController @@ -128,9 +127,9 @@ class ShoppingCartPluginProfileController &lt; ProfileController
128 render :text => { 127 render :text => {
129 :ok => false, 128 :ok => false,
130 :error => { 129 :error => {
131 - :code => 2,  
132 - :message => _("There is no cart.")  
133 - } 130 + :code => 2,
  131 + :message => _("There is no cart.")
  132 + }
134 }.to_json 133 }.to_json
135 return false 134 return false
136 end 135 end
@@ -144,9 +143,9 @@ class ShoppingCartPluginProfileController &lt; ProfileController @@ -144,9 +143,9 @@ class ShoppingCartPluginProfileController &lt; ProfileController
144 render :text => { 143 render :text => {
145 :ok => false, 144 :ok => false,
146 :error => { 145 :error => {
147 - :code => 3,  
148 - :message => _("This enterprise doesn't have this product.")  
149 - } 146 + :code => 3,
  147 + :message => _("This enterprise doesn't have this product.")
  148 + }
150 }.to_json 149 }.to_json
151 return nil 150 return nil
152 end 151 end
@@ -158,9 +157,9 @@ class ShoppingCartPluginProfileController &lt; ProfileController @@ -158,9 +157,9 @@ class ShoppingCartPluginProfileController &lt; ProfileController
158 render :text => { 157 render :text => {
159 :ok => false, 158 :ok => false,
160 :error => { 159 :error => {
161 - :code => 4,  
162 - :message => _("The cart doesn't have this product.")  
163 - } 160 + :code => 4,
  161 + :message => _("The cart doesn't have this product.")
  162 + }
164 }.to_json 163 }.to_json
165 return false 164 return false
166 end 165 end
@@ -172,9 +171,9 @@ class ShoppingCartPluginProfileController &lt; ProfileController @@ -172,9 +171,9 @@ class ShoppingCartPluginProfileController &lt; ProfileController
172 render :text => { 171 render :text => {
173 :ok => false, 172 :ok => false,
174 :error => { 173 :error => {
175 - :code => 5,  
176 - :message => _("Invalid quantity.")  
177 - } 174 + :code => 5,
  175 + :message => _("Invalid quantity.")
  176 + }
178 }.to_json 177 }.to_json
179 return false 178 return false
180 end 179 end
plugins/shopping_cart/views/cart.html.erb
  1 +<% enterprise_identifier = !locals[:cart].nil? ? Enterprise.find(locals[:cart][:enterprise_id]).identifier : 'bli'%>
1 <div id="cart1" class="cart" style="display:none" 2 <div id="cart1" class="cart" style="display:none"
2 data-l10nRemoveItem="<%=_('Are you sure you want to remove this item?')%>" 3 data-l10nRemoveItem="<%=_('Are you sure you want to remove this item?')%>"
3 data-l10nCleanCart="<%=_('Are you sure you want to clean your cart?')%>"> 4 data-l10nCleanCart="<%=_('Are you sure you want to clean your cart?')%>">