Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

1062 - Duplicate entry


Gornik

Recommended Posts

Hi,

 

I have installed 2.3.3 version. After that I have installed Discount code Addon. First discount code was created successfuly. When I tried to create anather one right after the first one, the note bellow was appeared. Can anyone please explaind how to solve the problem that I will be able to use more then just one discount code at the same time. So, beside the first code I would like to create ''New discount code''. I would be grateful for you help.

Thanks and BR,

Matjaz

 

1062 - Duplicate entry '0' for key 1

insert into discount_codes (products_id, categories_id, manufacturers_id, excluded_products_id, customers_id, orders_total, order_info, exclude_specials, discount_codes, discount_values, minimum_order_amount, expires_date, number_of_use, number_of_products) values ('1028', '', '', '', '', '0', '1', '0', '97d4fb08', '30%', '', '2015-03-05', '1', '1')

[TEP STOP]

Link to comment
Share on other sites

Gornik, the latest version is 2.3.4, did you have a particular reason not to use it?

 

Also if you provide the exact community plugin link you used to download "Discount code Addon" then we would know which plugin and version you were asking for help on.

 

SQL 1062 ? 

SQL 1062 in general tells me that you are having primary key issues. (database table related to the insert statement)

 

..about the SQL if that is where the error is, are you trying to insert more then 1 row in a table with the same primary key?  If you look at the database table does it tell you which fields are the primary keys?  Just ensure that you are using a different primary key set when you insert a new row into the table.  As more then one column of data can be part of the primary key make sure you identify each that are.

 

in the table is there already a discount with a code of 97d4fb08 ? If there is another table that gets created with the mod you would need to keep the codes in sync.  But for now if you just change the code to something like 97d4fb06 and statement to:

 

"insert into discount_codes (products_id, categories_id, manufacturers_id, excluded_products_id, customers_id, orders_total, order_info, exclude_specials, discount_codes, discount_values, minimum_order_amount, expires_date, number_of_use, number_of_products) values ('1028', '', '', '', '', '0', '1', '0', '97d4fb06', '30%', '', '2015-03-05', '1', '1')"

 

does it work? My gut says there just needs to be a different unique code for the discount...  I can only speculate as I would need the exact link to the osc mod page to download it and see...

 

-BP

Link to comment
Share on other sites

Hi, I am sorry for late reply. There is no particular reason not having latest version of Osc. Just lack of time. I have installed discount_code_3.2_for_oscommerce_online_merchant.2.3.1 (http://addons.oscommerce.com/info/7700/v,23)

 

I can see in database that discount_codes_id is primary key. I haven't change my database yet because I am not sure how to do it exactly. Should be added a row or created new table? I wanted to quote database table but I was not able to do that.

Thanks for you help.

Regards

Link to comment
Share on other sites

you should check out this version:

 

https://github.com/newburns/osCommerce-234-bootstrap-wADDONS

 

or

download 2.3.4

 

Keep in mind a lot of the add ons are very old code. if you do Add ons keep a reference of changes made. In time many of the contributions at least the good ones will be implemented in the new way. That version I gave you added CCGV it is still a bit buggy but I fixed the Paypal issue and it is now working on the coupon end. However, gift vouchers maybe a problem still

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...