Jump to content

Problem with adding product into category

Recommended Posts

Hello all,
I have a product which works fine with it's specific price.
The problem is when I want to add this into another category, SQL returns this error:

INSERT INTO `ps_specific_price` (`id_shop_group`, `id_shop`, `id_cart`, `id_product`, `id_product_attribute`, `id_currency`, `id_specific_price_rule`, `id_country`, `id_group`, `id_customer`, `price`, `from_quantity`, `reduction`, `reduction_tax`, `reduction_type`, `from`, `to`) VALUES ('0', '1', '0', '16644', '0', '0', '19', '0', '0', '0', '-1', '1', '0.1', '0', 'percentage', '2019-11-07 00:00:00', '2019-11-21 00:00:00')

Duplicate entry '16644-0-0-0-2019-11-07 00:00:00-2019-11-21 00:00:00-1-0-0-0-0-1-' for key 'id_product_2'

First of all, I don't know why it should modify ps_specific_price when nothing related to price changed and only categories are going to be changed.
Second, Of course it's duplicate entry for that index key, because it has already been defined as special product.

Even when I manually delete this key from ps_specific_price, it returns the same error but the key shows again in the ps_specific_price, it means it gets added but Prestashop run the SQL command again.

Any idea on this?


Share this post

Link to post
Share on other sites

The error states the following:

You trying to insert a new line in MYSQL. Buth the ID (id_product) you want to insert already exist.

So you already have a product id "16644"

Share this post

Link to post
Share on other sites

I know how to read SQL commands and errors. :)

I want to know why such this happens when I want to add an existing product into a new category.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More