Jump to content

Search Products By Ean Codes


my-software

Recommended Posts

Hi all,

I'm trying to make a modification by adding fields to search products by ean13 field.

 

So I added:

$this->fields_list['ean13'] = array(
	'title' => $this->l('ean13'),
	'align' => 'left',
	);

It was ok but I want to search products by poducts attributes ean13 field too.

 

So I try to add join only when I search product by ean13 field (please notice that as result I want only product, not all option)

if(isset($context->cookie->productsproductFilter_ean13)){
        $this->_join .= " INNER JOIN `ps_product_attribute` pa ON a.`id_product` = pa.`id_product` and pa.ean13 like '%".$context->cookie->productsproductFilter_ean13."%'";
	$this->_select .= ' , pa.`ean13`, ';
}		

After  syste show me error:

Column 'ean13' in where clause is ambiguous (Of course this is the correct error).

 

Summary how I can search product by product ean13 or product options ean13 (if have it) ?

 

Can you help me to resolve this problem?

 

 

 

 

Best,

Peter

Edited by my-software (see edit history)
Link to comment
Share on other sites

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...