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 | 226 | end |
227 | 227 | |
228 | 228 | def register_order(custumer, items) |
229 | + new_items = {} | |
229 | 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 | 232 | end |
232 | 233 | ShoppingCartPlugin::PurchaseOrder.create!( |
233 | 234 | :seller => profile, |
234 | 235 | :customer => user, |
235 | 236 | :status => ShoppingCartPlugin::PurchaseOrder::Status::OPENED, |
236 | - :products_list => items, | |
237 | + :products_list => new_items, | |
237 | 238 | :customer_name => params[:customer][:name], |
238 | 239 | :customer_email => params[:customer][:email], |
239 | 240 | :customer_contact_phone => params[:customer][:contact_phone], | ... | ... |