Product Price for Javascript

Our finance team have given us a simple script which shows a finance table for each of our products.
This table comes from an external script, however it needs to use the product price to build the table.

And example of this would be

The financePrice is sent to the script and it returns a table for a finance breakdown.
However, I cannot for the life of me find out how to reference this price in wix. Other platforms I can edit the PHP and use product variables to insert into the HTML. However Im lost with Wix.

(its either too simple or I’m missing something huge)

Can anyone help please

Did you place this code inside an HTML element (iframe)? If so, you can communicate between iFrames and page code with post message

I added the script to settings product page scripts, so it appears at the end of the code. everything working fine, however just need to know how to insert product price in there :frowning:

to add, here is the page: shepherds windermere

site custom code (product page) has the scripts in. Im no Wix expert, however did this in shopify in like 5 mins , im 5 days on here and struggling as nobody actually posts a solution.

If you need to be able to interact with the script in the page code itself, you will want to use Custom elements or HTML/iframe elements. In your case, using the HTML and post message method is likely the approach that makes sense. See the article below for how to use them.

HTML Elements

really sorry, thats not told me how to get the productprice into my script.

can you confirm there are really no variables you can use for replacement.

example

%productprice% etc , or is this all javascript run?? 5 days in and I find im having to learn a whole new system when really it should be quite simple

Yes, when using new systems you will have to take some time to learn how they work hence why I posted the article above. We do not use variables in the format you are suggesting.

We have many resources for learning how to code in Velo. You can take a look through this category in the forum if you would like to learn.

Getting Started

You can pass variable information from the HTML element to your page and define them however you like. To communicate back and forth should that be needed you can use postmessage.

You also can look into custom elements, which are similar in nature to web components if you have worked with those before.

It will be all JavaScript whether you are writing backend or frontend code within the editor IDE.

In all honesty we dont want to learn a whole new system, we had been asked to add one line of script which includes the product price onto the wix product page.

Can nobody show us a line of code to extract the product price from the product page?

thanks