Is it possible show output of JavaScript as price of a product?
-
We are selling corrugated boxes. I want to add form to product page, in which user will input Length, Width and Height. I want to use those input values to make calculations of price of the product. Is it possible to use ‘result’ value of below code, as price of the product, how do I do it?
Number 1:
Number 2:
The result is:
WP.com: Yes
Jetpack: Yes
Correct account: YesThe blog I need help with is: (visible only to moderators and staff)
-
Code seems to be not shown in above post. Code:
<!DOCTYPE html> <html> <body> <form> <label for="num1">Number 1:</label><br> <input type="text" id="num1" name="num1"><br> <label for="num2">Number 2:</label><br> <input type="text" id="num2" name="num2"><br><br> <input type="button" value="Add" onclick="addNumbers()"> </form> <p>The result is:</p> <p id="result"></p> <script> function addNumbers() { var num1 = parseInt(document.getElementById("num1").value); var num2 = parseInt(document.getElementById("num2").value); document.getElementById("result").innerHTML = num1 + num2; } </script> </body> </html> -
Hi there,
I see we already helped with that via live chat. Should you have any more questions or need additional help, please don’t hesitate to ask. We’re always here and happy to help!
-
Hi, in live chat, I was not said about a way to use code, to get asked thing in question (I was asked to use extensions or hire developer). Can you please say me a way to show output of JavaScript as price of a product, via code?
Thank you
-
Hey there,
Thanks for reaching back out.
Can you please say me a way to show output of JavaScript as price of a product, via code?
We wouldn’t be able to advise or provide code, as this would be outside the scope of the support we provide.
It looks like you looking to sell quite specific items via your site, and so I’d like to make a suggestion.
We provide a Built by WordPress service: https://wordpress.com/built-by-wordpress-com/ whereby we can build the website for you, using the plugins that you need. It’s proving quite popular recently for those building ecommerce sites, because such as what you’re finding – products come in all kinds of variations and sizes.
It can also save time in the long run, as it’s possible to purchase post build support, should you need to change anything, or something needs fixing.
I hope this is useful information and food for though!
- The topic ‘Is it possible show output of JavaScript as price of a product?’ is closed to new replies.