Jump to content

Search by product reference


Asma BELHEDI

Recommended Posts

Hello,

I have a big problem :/ with prestashop 1.6.0.11.

 

the search engine does not work properly

 
Indeed, when I type for example the reference JN-10-10 the module is working but while I type S-JN-1 or T-2-2 the module not working.
 
I already try to re-index in preference / research but it changes nothing.
 
Also i added the following code in this location /override/classes/Search.php:
 

<?php

 

class Search extends SearchCore

{

        public static function getAttributes($db, $id_product, $id_lang)

        {

               if (!Combination::isFeatureActive())

                       return '';

 

               $attributes = '';

               $attributesArray =

        $db->executeS('SELECT al.name, pa.reference FROM '._DB_PREFIX_.'product_attribute pa

        INNER JOIN '._DB_PREFIX_.'product_attribute_combination pac ON pa.id_product_attribute = pac.id_product_attribute

         INNER JOIN '._DB_PREFIX_.'attribute_lang al ON (pac.id_attribute = al.id_attribute AND al.id_lang = '.(int)$id_lang.')

               '.Shop::addSqlAssociation('product_attribute', 'pa').'

               WHERE pa.id_product = '.(int)$id_product);

               foreach ($attributesArray as $attribute)

                       $attributes .= $attribute['name'] . ' ' . $attribute['reference']; // Webbax - recherche par référence déclinaison

               return $attributes;

        }

}

 but i cannot fix the problem. 

 
I do not understand why the search engine works while I type some references and does not work while I type another references.
Can someone tell me please?
I really need your help!
 

 

 

Link to comment
Share on other sites

  • 3 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...