How can I add a custom size price calculator to my website?

Hello, I am have trouble with the following problem.

My website will be meant for selling custom banners and signs. How can I add a calculator on the product page for the banner that will price it based on price per unit—-Then have the total be added to the cart?

Example: Customer wants a custom size of 3x5 Banner, Price per unit is $2.50 per square foot. Total: $37.50 - Add to cart

Will Wix allow this feature? Is there a way to code this?

There maybe a solution on the App Market

if not then custom code. Build a calculator and pass the info as a customLineItem using the Checkout API