Streaming live at 10am (PST)

CMS, Eccomerce simple calculation

Hello everyone. I have a question about e-commerce.

  1. You need to set a custom, unique tax on goods. I searched for information on the forum, it is written that the given time is impossible. Is that really so? Maybe someone has found a solution to this. (The only thing that for more than 3 years of use in webflow really disappoints me)

  2. The main issue that arose after the inability to add your own tax rate. It was decided to include the tax in the price of the goods. But in the order summary element, include the tax field.

Like this:

To do this, it was decided to write a part of the code that will calculate the tax on the subtotal amount to be paid by the buyer. (I know it’s wrong formula but it’s just for test :smile: )

As I checked it works on a regular CMS and works on static elements. You can see this in the test project. Link below.

I understand the problem that in the field of value (subtotal) is prescribed not only a numerical value, but also some letters - code.

Please help how to choose only a numerical value and subject it to the usual mathematical formula.

Or they will also share their ideas on how to solve their own tax problems for e-commerce.

Home Page: https://webflow-help-df5f29.webflow.io/
Checkout: Webflow Help
Read-Only: https://preview.webflow.com/preview/webflow-help-df5f29?utm_medium=preview_link&utm_source=designer&utm_content=webflow-help-df5f29&preview=bdee2f6c688a6efd4786025bf58d9f9a&mode=preview
Clone: webflow-help-df5f29 - Webflow

Is your question how to parse the data from that element to read the numerical value?

1 Like

Yes sir. At the moment, this is the main issue.

You could probably just use
Number.parseFloat(something) and either change your display format to remove the comma(,) character or remove it from the something first
something.replace(',', '')