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

Apply limitation price on subtotal as well #26

Merged
merged 6 commits into from
Jan 5, 2021

Conversation

ryanmitchell
Copy link
Member

Was trying to work out the best way to handle this without affecting other areas, so settled on applying on subtotal as well as price.

The other option is to add the option price onto the price in the price() method ?

@sampoyigi
Copy link
Member

Yup, it's a tricky one..

With your changes, it looks like conditions will be applied on the price twice, first within the price method and then subtotal.. Not sure if that's what you intended.

Maybe apply the conditions on $optionSum before calculating the subtotal? But then that would affect the condition calculatedValue property value. I think we should apply conditions only within the subtotal, then we wont have to worry about calculatedValue returning different values...

@ryanmitchell
Copy link
Member Author

ryanmitchell commented Jan 4, 2021 via email

@sampoyigi
Copy link
Member

Seen!

Shouldn't conditions be applied to the calculated subtotal not before?

@ryanmitchell
Copy link
Member Author

Pushed an update.
@BreakSecurity is there any way you would have time to test this?

@BreakSecurity
Copy link

BreakSecurity commented Jan 5, 2021

Do NOT work for me...

tastyigniter/ti-ext-coupons#9

Please note that this happen only when we apply restrictions to some menu items

@ryanmitchell
Copy link
Member Author

Latest commit works and is tested.

Copy link
Member

@sampoyigi sampoyigi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Ryan!!! Couldn't stop myself from refactoring 🤦

@sampoyigi sampoyigi merged commit a31842a into tastyigniter:master Jan 5, 2021
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.

3 participants