Jump to content

Attribute Error - Column 'id_product' in where clause is ambiguous


Recommended Posts

We have two installs of Prestashop 1.6 on two different servers.  When we try to add a attribute to any product, we get this error.

Column 'id_product' in where clause is ambiguous

UPDATE ps_product_attribute a
INNER JOIN ps_product_attribute_shop product_attribute_shop
    ON (product_attribute_shop.id_product_attribute = a.id_product_attribute AND product_attribute_shop.id_shop IN (2, 1))
SET a.default_on = '0', product_attribute_shop.default_on = '0' WHERE id_product = 82097

Anyone have ideas on how to fix this?

Link to comment
Share on other sites

HI,

you must specify the table name ( or alias, so in your case : a.id_product or product_attribute_shop.id_product )

As exemple your query became :
 

UPDATE ps_product_attribute a
INNER JOIN ps_product_attribute_shop product_attribute_shop
    ON (product_attribute_shop.id_product_attribute = a.id_product_attribute AND product_attribute_shop.id_shop IN (2, 1))
SET a.default_on = '0', product_attribute_shop.default_on = '0' WHERE a.id_product = 82097

Ch.

Link to comment
Share on other sites

Still having this issue and I can not find an answer.  

 

I'm getting two errors.  I get this error if I do NOT select the attribute combination as default
 

Field 'id_product' doesn't have a default value

INSERT INTO `ps_product_attribute_shop` (`id_product_attribute`, `wholesale_price`, `price`, `ecotax`, `weight`, `unit_price_impact`, `minimal_quantity`, `default_on`, `available_date`, `id_shop`) VALUES ('54946', '0', '0', '0', '0', '0', '1', '0', '0000-00-00', '2')

Then I get this error if I do select the attribute combination as default
 

Column 'id_product' in where clause is ambiguous

UPDATE ps_product_attribute a
                 INNER JOIN ps_product_attribute_shop product_attribute_shop
        ON (product_attribute_shop.id_product_attribute = a.id_product_attribute AND product_attribute_shop.id_shop IN (2, 1))
                SET a.default_on = '0', product_attribute_shop.default_on = '0' WHERE id_product = 82098

I know what the errors mean but why is prestashop giving me these errors when adding a attribute combination to a product in the admin section?  I do not even know which file is generating the SQL code to even look.  Any help please?

 

 

Little history:

We have a testing server we used.  We got the store going and moved it to another sever.  Following the directions on these forums we moved it and everything works fine.  This is the only issue we are having.  

Edited by wstar (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...