Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Make per item calculator only apply to matching products #1526

Closed
wants to merge 4 commits into
from

Conversation

Projects
None yet
3 participants

Per item calculator now applies only to products matching the promotion.

end
end
+
+ def target_products
+ #TODO: product groups?
@radar

radar May 11, 2012

Member

Left over TODO?

@metalelf0

metalelf0 May 11, 2012

The TODO shouldn't be there, but in the while I found some problems when
adding products with different promotions to the same cart, so please don't
pull this in. I'll add some commits as far as I know how to fix it.

AS

On 11 May 2012 03:03, Ryan Bigg <
reply@reply.github.com

wrote:

   end
 end
  • def target_products
  •  #TODO: product groups?
    

Left over TODO?


Reply to this email directly or view it on GitHub:
https://github.com/spree/spree/pull/1526/files#r806131

radar added a commit that referenced this pull request May 11, 2012

radar added a commit that referenced this pull request May 11, 2012

I found some problems when adding products with different promotions to the same cart, so please don't pull this in. I'll add some commits as far as I know how to fix it.

Owner

schof commented May 15, 2012

Can this issue be closed? Also, please rename so it's more descriptive of what the pull request is actually doing. Its fine to reference the issue in the description, its just not adding a lot of value as the subject.

@radar radar closed this in 94ab0e6 May 21, 2012

@radar radar reopened this May 21, 2012

Member

radar commented May 21, 2012

This commit breaks the build. I am about to go have some lunch, and I'll be looking at this after that.

radar added a commit that referenced this pull request May 21, 2012

radar added a commit that referenced this pull request May 21, 2012

[promo] Check for calculator on adjustment.originator in update_adjus…
…tments_with_promotion_listing before checking its type

Related up to #1526

radar added a commit that referenced this pull request May 21, 2012

[promo] massive cleanup of order_spec.rb
set up order spec right so that adjustments have an originator

Fixes breakages brought in by #1526
Member

radar commented May 21, 2012

1 burger, 1 30 minute bike ride (went home because office internet was not so good) and 2 hours later... I think I fixed it? Take a look at the latest commits, @metalelf0 and sanity check that for me. I think everything's still good there.

Thanks again for the pull request :)

@radar radar closed this May 21, 2012

radar added a commit that referenced this pull request May 21, 2012

[promo] massive cleanup of order_spec.rb and related code in
order_decorator.rb

Also, set up order spec right so that adjustments have an originator

Fixes breakages brought in by #1526

Ok, looks good to me. I think some more documentation should be written to explain how this promotion works: the PerItem promotion now applies only to its matching product, and the most valuable promotion is always picked. It may sound a little complicated at first, but it's the most obvious solution IMHO.

radar added a commit that referenced this pull request May 25, 2012

radar added a commit that referenced this pull request May 25, 2012

Member

radar commented May 25, 2012

Just a note, this pull request had a bug (#1596) in it which meant that I had to revert it and re-implement it in the two commits above this message. Not your fault at all, though! Totally ours because we didn't know it was being used in that way and we didn't have a test to fix it. Now we know and we have a test.

I hope this doesn't put you off wanting to contribute more patches to Spree.

Sorry, I should have noticed this before, I tried it with some use cases and I didn't see this error coming - I'm still quite new to the Spree codebase. Don't worry, if I'll find anything to fix I'll be more than happy to help, maybe with some more caution :)

Thanks!

radar added a commit that referenced this pull request May 29, 2012

radar added a commit that referenced this pull request May 29, 2012

radar added a commit that referenced this pull request May 29, 2012

[promo] Check for calculator on adjustment.originator in update_adjus…
…tments_with_promotion_listing before checking its type

Related up to #1526

radar added a commit that referenced this pull request May 29, 2012

[promo] massive cleanup of order_spec.rb
set up order spec right so that adjustments have an originator

Fixes breakages brought in by #1526

radar added a commit that referenced this pull request May 29, 2012

tvdeyen pushed a commit to magiclabs/spree that referenced this pull request Jun 1, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment