Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update promotion_actions_create_quantity_adjustments in core/engine #556

Merged
merged 1 commit into from
Jan 7, 2016

Conversation

philbirt
Copy link
Contributor

@philbirt philbirt commented Dec 1, 2015

I saw this while working on something else. It looks like we have already defined app.config.spree.calculators.promotion_actions_create_item_adjustments a few lines above. I think it was probably a copy-paste gone awry.

@jhawthorn
Copy link
Contributor

👍 Indeed looks like bad copypasta

@cbrunsdon
Copy link
Contributor

yea, 👍 though what this code does is a bit of a mystery to me.

@philbirt
Copy link
Contributor Author

philbirt commented Dec 3, 2015

@cbrunsdon i believe its supposed to set which calculators are available for the different types of promotion actions. Although that its been like this for awhile is kind of telling that it may be useless.

@cbrunsdon
Copy link
Contributor

@philbirt yea, I always assumed lots/most of this was useless I just haven't had time to look into it. @adammathys might know as he has dealt with way more of the promo stuff than I have.

@adammathys
Copy link
Contributor

Ugh! Definitely a bad copy/paste on my part. The reason this works is because the admin view just re-uses the item adjustments one.

I suppose having Spree::Promotion::Actions::CreateQuantityAdjustments.calculators return the correct thing might be useful. Maybe we should just update this to read:

app.config.spree.calculators.promotion_actions_create_quantity_adjustments =
  app.config.spree.calculators.promotion_actions_create_item_adjustments

Since that's technically the most correct answer. (Although it does mean the FlexRate calculator would become available for quantity adjustments. Which might work. I'm not certain.)

@jhawthorn jhawthorn added this to the 1.2.0 milestone Dec 23, 2015
jhawthorn added a commit that referenced this pull request Jan 7, 2016
Update promotion_actions_create_quantity_adjustments in core/engine
@jhawthorn jhawthorn merged commit ddfb61a into solidusio:master Jan 7, 2016
@scottcrawford03 scottcrawford03 deleted the quantity_adjustments branch November 17, 2017 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants