Answer the question
In order to leave comments, you need to log in
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');
Answer the question
In order to leave comments, you need to log in
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&width=100%25&height=373&lang=ru_RU&scroll=true"></script>');
}
}));
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&width=100%25&height=373&lang=ru_RU&scroll=true"></script>');
}
}));
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question