-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
✨Marketplace
: Collect Taxes for Product
s with a TaxRate
on Checkout
#1200
Conversation
3113dfc
to
5e7c58b
Compare
Marketplace
: Collect Taxes for Product
s with a TaxRate
on Checkout
Marketplace
: Collect Taxes for Product
s with a TaxRate
on Checkout
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thank you!
app/furniture/marketplace/cart.rb
Outdated
def tax_total | ||
cart_products.sum(0) do |cart_product| | ||
cart_product.tax_amount | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this just cart_products.sum(&:tax_amount)
?
|
||
validates_uniqueness_of :product, scope: :cart_id | ||
validate :editable_cart | ||
|
||
attribute :quantity, :integer, default: 0 | ||
|
||
def tax_amount | ||
price_total * (tax_rates.sum(0) do |tax_rate| | ||
tax_rate.tax_rate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above, I think this can be price_total * (tax_rates.sum(&:tax_rate) / 100)
…kout` - #1137 Whoooo! `TaxRate` gets calculated! And collected! Co-authored-by: Ana Ulin <anaulin@users.noreply.github.com> Co-authored-by: Dalton Pruitt <daltonrpruitt@users.noreply.github.com> Co-authored-by: Kelly Hong <KellyAH@users.noreply.github.com>
5e7c58b
to
1cc1052
Compare
Marketplace
:Tax
Collection and Compliance #1137Whoooo!
TaxRate
gets calculated! And collected!tax-rates-demo.mp4