I need to get the result value of this calculator to add to the cart from the product page for both single and configurable products.
I add the calculator to catalog_product_view.xml
Then I copied the code from addtocart.phtml to calc.phtml as the button and changed the QTY to my result value (var metres)
< ?php if ($block->shouldRenderQuantity()) :?>
< ?php endif; ?>
< ?= $block->getChildHtml('', true) ?>
The block didn’t even appear once I put the above code in. Any help would be appreciated