I
I
Ilya Filonov2020-06-17 17:33:53
opencart
Ilya Filonov, 2020-06-17 17:33:53

Search in Opencart?

Good afternoon!

In the online store (marvisalon.ru) on the main page there is a search bar. She works and searches according to the words, as it should. However, when the query is executed, it takes you to the Search Results page, which also has a string. But she no longer wants to look for anything. Any suggestions? I can show the necessary code

. UPD: The same problem is everywhere where I set up a search through the code: Categories, product card, etc.

What I did:
In category.twig
search.twig
home.twig I inserted {{ search}}

In the controller in category.php
search.php
home.php I inserted

$data['search'] = $this->load->controller('common/search');


According to this scenario, everything worked on the home page (home.twig), does not work on the search results page (search.twig) and product categories (category.twig)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
secretsergey, 2020-06-17
@secretsergey

I took the search page as an example.
catalog/view/theme/marvi/html/js/main.js
Try replacing:

var prices = $('.prices');
    var pricesTop = prices.offset().top;

    $(window).bind('scroll', (function(){
        var windowTop = $(this).scrollTop();
        if (windowTop > pricesTop) {
            $(window).unbind('scroll');
            $('.map').html('<script type="text/javascript" charset="utf-8" async src="https://api-maps.yandex.ru/services/constructor/1.0/js/?um=constructor%3A6f395da07b4cc10029b3d2589ad9899f17ad6d15aed62d554f3955a7e1fe09f9&amp;width=100%25&amp;height=373&amp;lang=ru_RU&amp;scroll=true"></script>');
        }
    }));

On the:
var prices = $('.prices');
    if (prices.length) {
    var pricesTop = prices.offset().top;

    $(window).bind('scroll', (function(){
        var windowTop = $(this).scrollTop();
        if (windowTop > pricesTop) {
            $(window).unbind('scroll');
            $('.map').html('<script type="text/javascript" charset="utf-8" async src="https://api-maps.yandex.ru/services/constructor/1.0/js/?um=constructor%3A6f395da07b4cc10029b3d2589ad9899f17ad6d15aed62d554f3955a7e1fe09f9&amp;width=100%25&amp;height=373&amp;lang=ru_RU&amp;scroll=true"></script>');
        }
    }));
    }

PS At you 2 more times jq of different versions is connected.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question