Fix multiple tabs open on print invoice/shipping button opencart 3.x

(Last Updated On: August 24, 2020)
There is a minor bug in the Opencart when clicking the print invoice/shipping button on the order list page in the Opencart 3.x version.

What is the issue?

The issue is it opens the invoice in the same tab and also in a new tab. So 2 tabs are open which is little frustrating.

How to fix?

The issue is related with the common.js file. There was a problem in the Internet explorer for which a fix was added in the common.js and this issue caused the issue with opening of multiple tabs. The fix added was:

$(‘button[type=\’submit\’]’).on(‘click’, function() {
$(“form[id*=’form-‘]”).submit();
});

Code added in the common.js file

Go to below path on your server and open common.js:

admin/view/javascript/common.js

The line no should be 27. Or you can find these lines below

$(‘button[type=\’submit\’]’).on(‘click’, function() {
$(“form[id*=’form-‘]”).submit();
});

You can remove these lines and save the file. Once done clear your browser cache or try in the new browser.

Kindly note if you are using IE then don’t remove this code. If you are using chrome or other browser it is safe to remove it.

Leave a Reply

Your email address will not be published.