Hello everybody. I have a little problem. I want t...
# support
b
Hello everybody. I have a little problem. I want to remove the tax decimals in the cart view...
โœ… 1
But I dont know how to do it. I have followed the code flow...
I think taht the label is generated in;
app/components/filter_component.rb
But I dont know where I must pass it`to_int`.
Thanks in advance.
n
the local assignment is probably a tax Adjustment - if you were to run
Spree::Adjustment.tax
you should see it pop up I think there is a way to change the label of that tax adjustment - let me see if I can figure it out
b
Thanks @Naoki Mi. Yes, I did it...
I can modify the label by the Rails console. But I dont know how to do it in the code.
n
Iโ€™ve been looking through the solidus source code but also found nothingโ€ฆ could you check if there is a /admin/adjustments endpoint which lets you customize it?
b
Ok. I wil check it. Thanks.
I think that the tax label is generated in
app/components/filter_component.rb
n
I think I have a lead for the moment you can turn off showing the percentage amount at /admin/tax_rates
b
Thanks @Naoki Mi Yes. I knew it. But I need to show the rate of the tax.
๐Ÿ‘Œ 1
I'm sorry for the inconvenience.
n
no worries, itโ€™s an interesting puzzle ๐Ÿ™‚ the label comes from the locale
vat_with_rate
which pulls out the name, amount, and adds
(Included in Price)
what I need to figure out now is why the amount is the way it is and how to change it
maybe you could write your own locale and just hard-code it eg:
Copy code
fr:
  spree:
    adjustment_labels:
      vat_with_rate: TVA 21% (Comprise dans le prix)
b
Good idea. By the moment I'll do this, because I use only one tax rate in my store. Thanks @Naoki Mi.
๐Ÿ‘ 1
n
I openend the following PR: https://github.com/solidusio/solidus/pull/4758 thank you for raising this issue @BFX462heo ๐Ÿ™Œ
๐Ÿ‘ 1
b
I've followed your idea and this is how it looks...
Thanks a lot @Naoki Mi for your help and for the PR in Solidus GitHub. Great community. ๐Ÿ‘
๐Ÿ‘ 1
n
happy to help ๐Ÿ™‚
e
I was curious as well, and I think it's coming from here: https://github.com/solidusio/solidus/blob/master/core/app/models/spree/tax_rate.rb#L112 it'd be cool to control the precision via config setting there
b
Thanks for your help @Edwin Cruz and sorry for the delay in my answer, I was travelling. I want to fix this little problem but my ignorance about Rails is not little. It is very big. ๐Ÿคฏ Where can I find the `tax_rate.rb`file? I have looked for it in my VSCode but I can not find it. Sorry for the inconvenience. ๐Ÿ™