wp-user-frontend icon indicating copy to clipboard operation
wp-user-frontend copied to clipboard

Required Product Image field is not behaving as a required one in the WooCommerce Product upload form template.

Open nabid-anzum opened this issue 2 years ago • 4 comments

Description: If Product Image field in the WooCommerce Product upload form template is set required, then it is not working as a required one. If user click the submit button of that form without populating the Product Image field, the form uploads the product. Product can be found in the db without Product image.

How to reproduce the issue:

  • Go to WP Admin Panel -> WP user Frontend -> Post Form -> Add Form
  • Select the WooCommerce Product form template.
  • Make sure that Product Image field is required https://snipboard.io/rMmftV.jpg
  • Publish the form to a page.
  • Submit a product by using this form from the frontend.
  • Don't upload image in the Product Image field.
  • It will upload the product without image, although image was required.

Expected Behaviour: The form should not let the user upload product without the image if Product Image field is required.

System Status: WooCommerce: v6.3.1 WP User Frontend lite: v3.5.27

nabid-anzum avatar Mar 23 '22 04:03 nabid-anzum

Hello @nabid-anzum,

Please replace wp-content/plugins/wp-user-frontend/assets/js/frontend-form.js with this file

And replace wp-content/plugins/wp-user-frontend/assets/js/frontend-form.min.js with this file. Feel free to notify me of any queries.

sapayth avatar Mar 23 '22 06:03 sapayth

Hi,

This snippet does not make the image field mandatory. Is there anything else that needs to be changed?

alganoglumertcan avatar Apr 17 '22 14:04 alganoglumertcan

Hello @alganoglumertcan, Sorry to hear that you still get the problem. As we checked, it seems working on our end. There might be a conflict with another plugin or theme. Let's do a conflict test to be confirmed.

  1. Please deactivate all plugins except the WP User Frontend and WP User Frontend Pro.
  2. Use a default theme such as twenty-twenty.
  3. Clear your site cache as well as the browser cache. Then try again.

If you're still getting that problem, please contact our support so that we can check it in every possible way.

sapayth avatar Apr 18 '22 03:04 sapayth

The above solution sorts my issue. I replaced the two files, frontend-form.js and frontend-form-min.js and it works fine now. the form doesn't submit without an image. Thank you team.

ngigiGodfrey avatar Aug 04 '22 07:08 ngigiGodfrey