Duplicate entry '4' for key 'PRIMARY'
I have completed the checkout wizard with partial success. I am writing the visitor and cart details to my own simplified database tables, namely: promo and promo details based on the setup of the wa_ecommerce free database.
After writing to the database, I am successfully sending an email to the user and to the site owner.
If I only have one product in my shopping cart and complete the checkout process, I have complete success.
If however, I have more than one product in the shopping cart, I get the following error when testing: Duplicate entry '4' for key 'PRIMARY' but it does email if the cart contains multiple items.
I believe this is in relation to the promo details database table that stores the. promotion details
I have tried fiddling with the bindings to the primary ID key and foreign ID key. As soon as I removed the binding from the primary ID key column, I get an error stating that this field must have an entry. By default in the wizard process this is the value that has been bound:
<?php echo ((isset($_SESSION["ssCartPromo_OrderID"]))?$_SESSION["ssCartPromo_OrderID"]:""); ?>
Is this column not supposed to be an auto incrementing field?
promo table fields:
promoid, promoname, promosurname, promoemail ….
promodetails table fields:
promodetailid, detailpromoid, promodetailcode, promodetailname ...
I do unfortunately not know how or what information to bind to the following key which is the ID of the promotion table.
When testing on my local server, (and returning to the cart page from Dreamweaver) after completing the checkout process, I noticed that the same items are still in the shopping cart. They are not being cleared from the shopping cart. How do I correct this?
Appreciate the help.