Commit 2c7248fa3c434d863c3c61f75e7d117fbef049a9
1 parent
7cf6b019
Exists in
master
and in
22 other branches
[purchase-order] Fixing items
Showing
1 changed file
with
3 additions
and
2 deletions
Show diff stats
plugins/shopping_cart/controllers/shopping_cart_plugin_profile_controller.rb
@@ -226,14 +226,15 @@ class ShoppingCartPluginProfileController < ProfileController | @@ -226,14 +226,15 @@ class ShoppingCartPluginProfileController < ProfileController | ||
226 | end | 226 | end |
227 | 227 | ||
228 | def register_order(custumer, items) | 228 | def register_order(custumer, items) |
229 | + new_items = {} | ||
229 | items.each do |id, quantity| | 230 | items.each do |id, quantity| |
230 | - items[id] = {:quantity => quantity, :price => Product.find(id).price} | 231 | + new_items[id] = {:quantity => quantity, :price => Product.find(id).price} |
231 | end | 232 | end |
232 | ShoppingCartPlugin::PurchaseOrder.create!( | 233 | ShoppingCartPlugin::PurchaseOrder.create!( |
233 | :seller => profile, | 234 | :seller => profile, |
234 | :customer => user, | 235 | :customer => user, |
235 | :status => ShoppingCartPlugin::PurchaseOrder::Status::OPENED, | 236 | :status => ShoppingCartPlugin::PurchaseOrder::Status::OPENED, |
236 | - :products_list => items, | 237 | + :products_list => new_items, |
237 | :customer_name => params[:customer][:name], | 238 | :customer_name => params[:customer][:name], |
238 | :customer_email => params[:customer][:email], | 239 | :customer_email => params[:customer][:email], |
239 | :customer_contact_phone => params[:customer][:contact_phone], | 240 | :customer_contact_phone => params[:customer][:contact_phone], |