Help me understand why only OrderController#edit calls associate_user<https://github.com/spree/spree/blob/master/frontend/app/controllers/spree/orders_controller.rb#L38>and not
OrderController#populate<https://github.com/spree/spree/blob/master/frontend/app/controllers/spree/orders_controller.rb#L44>.
It is logical (to me) that for many user-based promotion rules, we need the
order to know about who the current user is to be able to determine
promotion eligibility when adding items to the cart. Without setting the
order's user before firing spree.order.contents_changed<https://github.com/spree/spree/blob/master/frontend/app/controllers/spree/orders_controller.rb#L48>,
user-based promotion rules yield unexpected results.

If there is some resistance to modifying the controller, perhaps it would
be best to allow Promotion#eligible?<https://github.com/spree/spree/blob/master/core/app/models/spree/promotion.rb#L60>to pass in spree_current_user by using the
default_notification_payload<https://github.com/spree/spree/blob/master/core/lib/spree/core/controller_helpers/common.rb#L29>
.

This seems to be how some of the built in promotion rules were designed, ready
to accept options<https://github.com/spree/spree/blob/master/core/app/models/spree/promotion/rules/first_order.rb#L6>,
but they never get passed!

(Cross post from https://github.com/spree/spree/issues/2583)

--
You received this message because you are subscribed to the Google Groups "Spree" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spree-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupspree-user @
categoriesrubyonrails
postedFeb 19, '13 at 2:44p
activeFeb 19, '13 at 2:44p
posts1
users1
websitespreecommerce.com
irc#RubyOnRails

1 user in discussion

Brian Buchalter: 1 post

People

Translate

site design / logo © 2022 Grokbase