If you’re using the new Wix Forms, then inside the form editor, click on the Field > Settings > Advanced and note the Field Key of the particular fields that you want to be pre-filled.
Then go to the editor, (make sure coding is enabled), open up your lightbox and use this code:
import { lightbox } from "wix-window-frontend";
$w.onReady(function () {
let receivedData = lightbox.getContext();
$w("#requestAQuoteForm").setFieldValues({
product_name: receivedData.product.name
});
});
Ofcourse, if your field key is different, simply replace the field key in the code from product_name to your own. Also change the ID of your form to #requestAQuoteForm inside the element properties panel next to the code panel.
You can even set multiple fields together, like so:
import { lightbox } from "wix-window-frontend";
$w.onReady(function () {
let receivedData = lightbox.getContext();
$w("#requestAQuoteForm").setFieldValues({
product_name: receivedData.product.name,
product_quantity: receivedData.quantity,
// add more field keys and values if needed...
});
});
Mapping the data that you send from the product page to the lightbox to the field keys of your form is the most crucial step. Once you get this right, you should be able to see the data of the particular product in your form submissions as well as your automated emails.
And regarding your second question,
This error usually occurs for some reason, but nothing to worry about. Your code should work just fine as long as you’ve correctly added it inside the ecom validations plugin.

