Get Product price CF7 data source

Hello @cmgcomunicazione

Thank you very much for using our plugin. You can pass the product id directly through the query.

For example, assuming your product’s id is 123, you can use the tags structure similar to:

<label> Product Price [text price] </label>

[cf7-recordset id="product-price" type="database" query="SELECT meta_value as price FROM {wpdb.postmeta} WHERE meta_key='_price' AND post_id=123"]

[cf7-link-field recordset="product-price" field="price" value="price"]

If you want to insert the form into any product and get its id (product id), the tags structure above can be edited as follows:

<label> Product Price [text price] </label>

[cf7-recordset id="product-price" type="database" query="SELECT meta_value as price FROM {wpdb.postmeta} WHERE meta_key='_price' AND post_id={post.id}"]

[cf7-link-field recordset="product-price" field="price" value="price"]

Best regards.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer