Duplicate Products are added in Opencart – submitting the same form twice

We are seeing issues in the Chrome browser for Opencart that it is adding duplicate products while adding the products, it looks like it is submitting the same form twice. We just commented on the form submission for the IE browser and it is not submitting duplicate products.

Duplicate products issues on Opencart

Go to admin/view/javascript/common.js and find the following lines of code:

$(document).ready(function() {
	//Form Submit for IE Browser
	$('button[type=\'submit\']').on('click', function() {
		$("form[id*='form-']").submit();
	});

Then comment out like below:

$(document).ready(function() {
	//Form Submit for IE Browser
	// $('button[type=\'submit\']').on('click', function() {
	// 	$("form[id*='form-']").submit();
	// });

After commenting on those lines of code it is not submitting the product twice, so there are no duplicate products inserted. We tested with test 3 products as in the above image.

Please don’t forget to post your questions or comments so that we can add extra topics. You can follow us at our twitter account @rupaknpl and subscribe to our YouTube channel for opencart tutorials.

Previous articleHow to setup Cloudflare easily for eCommerce websites like Opencart?
Next articleOpencart Module Development: Single Instance module, Form creation, validation, and submission to the database
Author of three Opencart book. The recent Opencart 4 book is at https://amzn.to/4dOlbOR

2 COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here