I had a Request A Quote button on certain product pages on my Magento 1.9 site and when clicked, it would bring users to a custom contact form which would have the Product Name field filled in with the name of the product they came from.
I done it in Magento 1.9 using the below on the custom contacts forms
<form method="post"> <?php $productName = $_POST['productname'];?> </form>
$productName in the field where needed.
How would I achieve this in Magento 2.2?
You can manage it like below:
Create a link with product id like http://example.com/quote-page/id/4 where 4 is the product id.
<a href="http://example.com/quote-page/id/4">Request A Quote</a>
When user click "Request a Quote" link then it will be redirected to quote page when you can get the product id by request parameter and then you can load the product name and show according to your requirement.