opencart icon indicating copy to clipboard operation
opencart copied to clipboard

Extension marketplace search/filter is broken

Open darkfires opened this issue 6 months ago • 6 comments

What version of OpenCart are you reporting this for? 4.0.2.3

Describe the bug Extension marketplace search does not work at all, nothing happens when you attempt to search and in developer tools console this JavaScript error shows up:

index.php?route=marketplace/marketplace&user_token=3c64ad376aae98b843c5d98ae2270260&filter_license=free:820 Uncaught ReferenceError: download is not defined at HTMLButtonElement. (index.php?route=marketplace/marketplace&user_token=3c64ad376aae98b843c5d98ae2270260&filter_license=free:820:5) at HTMLButtonElement.dispatch (jquery-3.7.1.min.js:2:40035) at v.handle (jquery-3.7.1.min.js:2:38006)

To Reproduce Steps to reproduce the behavior: in the Admin panel goto Extensions -> Marketplace and attempt to search/filter the results

Expected behavior Search results refined by the filter.

Server / Test environment (please complete the following information):

  • FreeBSD 14.2-RELEASE-p1
  • PHP 8.2
  • Apache version 2.4.63
  • Microsoft Edge, Chrome, Safari, Firefox

darkfires avatar Jun 07 '25 21:06 darkfires

Can confirm behaviour in version 4.1.0.3

websnail avatar Jun 19 '25 13:06 websnail

Know this is not about another opencart version, but Daniel, can you look at this issue:

searching on official opencart.com marketplace:

Searching keyword: "xml import pro" https://www.opencart.com/index.php?route=marketplace/extension&filter_search=xml%20import%20pro

Exact extension is on 3th page: https://www.opencart.com/index.php?route=marketplace/extension&filter_search=xml%20import%20pro&page=3

Can you please look at that? Thanks

DEAWid avatar Jun 28 '25 18:06 DEAWid

admin\view\template\marketplace\marketplace_list.twig

Find:

<script type="text/javascript"><!--
$('#button-filter').on('click', function(e) {
    var url = 'index.php?route=marketplace/marketplace&user_token={{ user_token }}';

    var input = $('#extension-filter :input');

    for (i = 0; i < input.length; i++) {
        if ($(input[i]).val() !== '') {
            url += '&' + $(input[i]).attr('name') + '=' + $(input[i]).val()
        }
    }

    download();

    location = url;
});

$('#input-search').keydown(function(e) {
    if (e.keyCode == 13) {
        e.preventDefault();

        $('#button-filter').trigger('click');
    }
});
//--></script>

Replace with:

<script type="text/javascript"><!--
$('#button-filter').on('click', function(e) {
    var url = 'index.php?route=marketplace/marketplace&user_token={{ user_token }}';

    var input = $('#extension-filter :input');

    for (i = 0; i < input.length; i++) {
        if ($(input[i]).val() !== '') {
            url += '&' + $(input[i]).attr('name') + '=' + $(input[i]).val()
        }
    }

    location = url;
});

$('#input-search').keydown(function(e) {
    if (e.keyCode == 13) {
        e.preventDefault();

        $('#button-filter').trigger('click');
    }
});
//--></script>

TLDR; Remove the un-used call to download(), not sure why that's there

exelaguilar avatar Jul 20 '25 22:07 exelaguilar

Nice simple fix @exelaguilar, thanks. It looks like Master branch version has completely rewritten this module.

jsobell avatar Jul 21 '25 00:07 jsobell

I'm getting this too (4.0.2.3), removing download(); does get rid of the error in dev console when loading the page, but doesn't get rid of the core issue of the extension marketplace not working (No results! no matter what filters I have on). Might be related but I also can't see anything in the Latest Version, Release Date or Change Log boxes under Maintenance -> upgrade. There's nothing in logs, the only error I could find is the above download() error but I don't think that's related.

BenTheNinjaRock avatar Nov 13 '25 16:11 BenTheNinjaRock