Magdalena Dziesińska
Magdalena Dziesińska

Reputation: 71

I cannot add a product in PrestaShop v1.6.1.0

I can't add product in back office. Prestashop 1.6.1.0 throws exception:

Unknown column 'product_attribute_shop.id_product' in 'on clause'

SELECT product_shop.id_product,
       Ifnull(product_attribute_shop.id_product_attribute, 0)
       id_product_attribute
FROM   `ps_product_reductions` pr,
       `ps_product` p
       INNER JOIN ps_product_shop product_shop
               ON ( product_shop.id_product = p.id_product
                    AND product_shop.id_shop = 1 )
       LEFT JOIN `ps_product_attribute_shop` product_attribute_shop
              ON ( p.`id_product` = product_attribute_shop.`id_product`
                   AND product_attribute_shop.`default_on` = 1
                   AND product_attribute_shop.id_shop = 1 )
WHERE  p.id_product = pr.id_product
       AND ( pr.id_product_attribute = 0
              OR product_attribute_shop.id_product_attribute =
           pr.id_product_attribute )
       AND product_shop.`active` = 1
       AND EXISTS(SELECT 1
                  FROM   `ps_category_product` cp
                         JOIN `ps_category_group` cg
                           ON ( cp.id_category = cg.id_category
                                AND cg.`id_group` = 1 )
                  WHERE  cp.`id_product` = p.`id_product`)
       AND product_shop.`visibility` IN ( "both", "catalog" )
ORDER  BY Rand()
LIMIT  1 

Upvotes: 1

Views: 3471

Answers (2)

Rutrus
Rutrus

Reputation: 1447

Maybe you taked data from Prestashop in other version, or your Prestashop did not upgrade correctly.

e.g. Changes in 1.6.1 database are here.

Upvotes: 1

User56756
User56756

Reputation: 352

This maybe a quick fix but it helped me. Are able to access phpmyadmin? Than go to your database and find the table

product_attribute_shop .

Add a column id_product to it with INT(10) and not null.

Than try to access your shop after doing this. the error should go away.Hope this helps.

Also I would suggest take a back up and upgrade your Prestashop version too.

Upvotes: 1

Related Questions