Jump to content

[Bug] Copying (Cloning) Product - Error While Creating Object Product - Duplicate Entry


konradb

Recommended Posts

Hi,

 

When I try to copy (duplicate) a product which has an assigned specific price (does not mater if it is on catalogue rules or specific prices on product prices tab) and added attrubutes combinations it generates error:

 

Duplicate entry '23-0-0-0-2015-10-01 00:00:00-2016-04-09 00:00:00-1-0-0-0-3-1-1' for key 'id_product_2'

 

INSERT INTO `ps1614_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', '23', '0', '0', '1', '0', '3', '0', '-1', '1', '0.1', '1', 'percentage', '2015-10-01 00:00:00', '2016-04-09 00:00:00')

 

It also does not copy product photos.

 

I tested it on two different hostings two versions of PrestaShop: running PrestaShop 1.6.1.3 and a fresh install 1.6.1.4 and results were the same - it looks like it is a 1.6.1 version bug, because it did not happen before.

 

How to reproduce this error:

1. Add a new catalog rule with % discount (or create specific price with % discount on product prices tab - same result)

2. Add a product combinations in product's tab

3. Add a specific price in products's tab

4. Clone product

 

Thank you for help.

Regards.

Link to comment
Share on other sites

  • 4 months later...
  • 3 months later...

hello,please test this and give some feedback if your problem is still not solved

 

 

 

i have the same problem,

maybe it's bug,

i found out,the error will happen on the products with  "Catalog Price Rules" ,

 

it will apply this rule twice when duplicating a product ,so try to avoid apply again,

 

 

please follow this pull request and have a test,thanks

 

https://github.com/PrestaShop/PrestaShop/pull/6469

Edited by TiaNex. (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...

hELLO, have you received some help about this issue???

i am having the same problem in upgraded prestashop from 1.6.0.9 to 1.6.1.5

 

some help please!!!!

 

Thanks in advance

hello,please test this and give some feedback if your problem is still not solved

 

 

 

i have the same problem,

maybe it's bug,

i found out,the error will happen on the products with  "Catalog Price Rules" ,

 

it will apply this rule twice when duplicating a product ,so try to avoid apply again,

 

 

please follow this pull request and have a test,thanks

 

https://github.com/P...aShop/pull/6469

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