To create a WordPress form that allows users to add products with images, quantity, and price, you can use a combination of form plugins and additional tools. Below is a structured breakdown of the best options, including setup guidance:
Top Solutions
1. Gravity Forms (Recommended for Flexibility)
Key Features :
Supports file/image uploads, number fields (quantity/price), and custom logic.
Integrates with add-ons like Gravity Forms Media Upload or Gravity Forms Product Addons .
Steps :
Install Gravity Forms (premium plugin).
Add fields:
Product Name : Text field.
Product Image : File Upload field (restrict to images).
Quantity : Number field (set min/max values).
Price : Number field (format as currency).
Use Gravity Forms Media Upload (or custom code) to handle image uploads.
Display submissions with Gravity View (optional) or custom templates.
2. WooCommerce (For E-Commerce Product Listings)
Best For : Selling products with built-in shopping cart functionality.
Steps :
Install WooCommerce .
Create product entries with:
Images : Featured image + gallery support.
Quantity : Stock management settings.
Price : Regular/sale price fields.
Allow vendor submissions with plugins like Product Vendors (for marketplaces).
3. Formidable Forms (Developer-Friendly)
Key Features :
Built-in templates for product submissions.
Supports file uploads, calculations (e.g., quantity × price), and dynamic field logic.
Steps :
Install Formidable Forms .
Create a form with:
Image Upload : File field.
Quantity : Number field.
Price : Currency field.
Use "Calculated Fields" to auto-calculate totals.
Store data in the database or display via custom views.
4. Advanced Custom Fields (ACF) + Frontend Submission
Best For : Developers needing full control.
Steps :
Install ACF Pro and a frontend form plugin (e.g., Frontend Dashboard ).
Create ACF fields:
Image : Image field.
Quantity : Number field.
Price : Number field.
Embed the form on the frontend using acf_form().
5. WPForms (User-Friendly)
Limitations : Lacks native image upload for products but works with add-ons.
Steps :
Install WPForms and the File Upload add-on.
Add fields:
Product Image : File Upload (restrict to .jpg/.png).
Quantity : Number field.
Price : Number field (format as currency).
Use third-party integrations (e.g., Zapier) to sync data with a CRM or database.
Example: Gravity Forms Setup
Fields :
Product Name : Single Line Text.
Product Image : File Upload (enable media library save).
Quantity : Number (min: 1, max: 100).
Price : Number (format as currency).
Display Submissions :
Use Gravity View to list products on the frontend.
Or create a custom template in your theme to loop through entries.
Custom Code Snippet (for Quantity × Price)
Add this to your theme's functions.php or a custom plugin:
php Copy code
// Example: Calculate total price (quantity × price) in Gravity Forms
add_action('gform_pre_render', 'calculate_total_price');
function calculate_total_price($form) {
foreach ($form['fields'] as &$field) {
if ($field->type == 'number' && $field->label == 'Price') {
$price_field_id = $field->id;
}
if ($field->type == 'number' && $field->label == 'Quantity') {
$quantity_field_id = $field->id;
}
}
// Add JS to calculate total
add_filter('gform_form_tag', function($form_tag, $form) {
$form_tag .= '<script>
jQuery(document).ready(function($) {
$("#input_'.$form["id"].'_'.$quantity_field_id.'").on("change", function() {
var price = $("#input_'.$form["id"].'_'.$price_field_id.'").val();
var quantity = $(this).val();
$("#input_'.$form["id"].'_total").val(price * quantity);
});
});
</script>';
return $form_tag;
}, 10, 2);
return $form;
}
Plugins You May Need
Final Notes
Non-Coders : Use Gravity Forms or Formidable Forms for drag-and-drop simplicity.
Developers : Combine ACF with custom templates for full control.
E-Commerce Needs : Prioritize WooCommerce for built-in product management.
Let me know if you need help choosing the best option for your use case! 🛠️