Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

ddmx

Новичок
  
  • Posts

    10
  • Joined

  • Last visited

Recent Profile Visitors

1,708 profile views

ddmx's Achievements

Newbie

Newbie (1/14)

  • First Post
  • Collaborator
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation

  1. В coolfilter.tpl замените: function setUrl(coolfilter) { var href = location.href; var exp = /(\?|\&)coolfilter=(.*)?(&|$)/g; href = href.replace(exp, ""); if (coolfilter) { href += '&coolfilter=' + coolfilter; } location = href; } на function setUrl(coolfilter) { var href = location.href; var exp = /(\?|\&)coolfilter=(.*)?(&|$)/g; var expage = /(\?|\&)page=(.*)?(&|$)/g; href = href.replace(exp, ""); href = href.replace(expage, ""); if (coolfilter) { href += '&coolfilter=' + coolfilter; } location = href; }
  2. лучше сгделать ик:1) в функции getProducts(); if (!empty($data['filter_name'])) { $implode = array(); $words = explode(' ', $data['filter_name']); $words = array_filter(array_unique($words), 'strlen'); foreach ($words as $word) { if (!empty($data['filter_description'])) { $implode[] = "LCASE(pd.name) LIKE '%" . $this->db->escape(utf8_strtolower($word)) . "%' OR LCASE(pd.description) LIKE '%" . $this->db->escape(utf8_strtolower($word)) . "%'"; } else { $implode[] = "LCASE(pd.name) LIKE '%" . $this->db->escape(utf8_strtolower($word)) . "%'"; } } if ($implode) { $sql .= " " . implode(" OR ", $implode) . ""; } } заменить if ($implode) { $sql .= " " . implode(" OR ", $implode) . ""; } на if ($implode) { $sql .= " " . implode(" AND ", $implode) . ""; } 2)И в функции getTotalProducts(); if (!empty($data['filter_name'])) { $implode = array(); $words = explode(' ', $data['filter_name']); foreach ($words as $word) { if (!empty($data['filter_description'])) { $implode[] = "LCASE(pd.name) LIKE '%" . $this->db->escape(utf8_strtolower($word)) . "%' OR LCASE(pd.description) LIKE '%" . $this->db->escape(utf8_strtolower($word)) . "%'"; } else { $implode[] = "LCASE(pd.name) LIKE '%" . $this->db->escape(utf8_strtolower($word)) . "%'"; } } if ($implode) { $sql .= " " . implode(" OR ", $implode) . ""; } } заменить if ($implode) { $sql .= " " . implode(" OR ", $implode) . ""; } на if ($implode) { $sql .= " " . implode(" AND ", $implode) . ""; } В итоге бугдет искать по 100% совпагдению + воспринимает люпотому чтой порядок слов . что бы найти "Велосипед Stels 410" можно вводить "410 Stels" , " велосипед 410" и.т.д.

×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.