Plugin that add additional product field that allow user to upload image files. After sucessfull uploading this image file should replace original product image after resizing to size of original product image.

WPTurbo » Snippets » Plugin that add additional product field that allow user to upload image files. After sucessfull uploading this image file should replace original product image after resizing to size of original product image.
0

Created with:

Visibility: 

public

Creator: Nedelcho Nedelchev

Customize with WPTurbo AI
X

Add Snippet To Project

New Project
Add To Existing Project
					<?php
// Display the additional product image upload field
echo '<div class="options_group">';
echo '<p class="form-field">';
echo '<label for="product_image">' . __('Product Image', 'wpturbo') . '</label>';
echo '<input type="file" name="product_image" id="product_image" />';
echo '</p>';
echo '</div>';
?>
				

Make sure to place this code where you want the field to appear in relation to the existing product information.

After adding this code, the additional image upload field will be visible to customers on the product page, allowing them to upload an image for the product.

Keep in mind that modifying theme files directly may cause issues during theme updates. It's recommended to create a child theme and place the modified 'single-product.php' file there to avoid losing your changes in future updates.

Register an account to save your snippets or go Pro to get more features.