You are here:  » Search for EAN number


Search for EAN number

Submitted by MarcoCH on Wed, 2018-11-14 20:21 in

Hello

I have followed many instructions to search for the EAN number.

https://www.pricetapestry.com/node/5034 (works and EAN is output in the product)

However, I can not search for EAN, how can I search for EAN, the description https://www.pricetapestry.com/node/4401 is relatively old, is that still valid?

Thanks for the hint.

regards
Marco

Submitted by support on Thu, 2018-11-15 08:02

Hello Marco,

I would create a new FULLTEXT index on (name,ean) to support this. The following dbmod.php script will create the index after truncating (emptying) the products table so you will need to re-import all feeds aftewards:

<?php
  set_time_limit
(0);
  
ignore_user_abort();
  require(
"includes/common.php");
  
$sql =
  
"TRUNCATE ".$config_databaseTablePrefix."products";
  
database_queryModify($sql,$result);
  
$sql =
  
"CREATE FULLTEXT INDEX name_ean
     ON "
.$config_databaseTablePrefix."products (name,ean)";
  
database_queryModify($sql,$result);
  print 
"Done.";
?>

Then following the full import, edit search.php and look for the following code at line 284:

            $matchFields = "name";

...and REPLACE with:

            $matchFields = "name,ean";

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by MarcoCH on Sun, 2018-11-18 09:18

Perfect ... thx!

Greets
Marco