I have an opencart project in which I used $('#some-id') as well as jQuery('#some-id') , which worked fine, but after upgrading the project from 1.5 to 2.1 its only host is jQuery('#some-id') and throwing error for $('#some-id') as
TypeError: $ (...) null
The following is my one of a hundred sample ajax functions.
$('#button-coupon').on('click', function() { $.ajax({ url: 'index.php?route=total/coupon/coupon', type: 'post', data: 'coupon=' + encodeURIComponent($('input[name=\'coupon\']').val()), dataType: 'json', success: function(json) { $('.alert').remove(); } }); });
Is there a way to make both work. I do not want to waste time replacing $ with jQuery ?
Below is a snapshot of the error in the firebug console.

If I change $('input[name=\'coupon\']') to jQuery('input[name=\'coupon\']') than to another line where $ is used. for example, see image below.

I tried using the latest as well as older versions of jQuery, but my problem still persists.
source share