Jump to content
Sign in to follow this  
honestshrubber

"Duplicate Entry" error

Recommended Posts

When I submit the information on Order_Info.php after selecting purchase without account, i get the following error message:

 

1062 - Duplicate entry '1' for key 1



insert into address_book (customers_id, address_book_id, entry_firstname, entry_lastname, entry_street_address, entry_postcode, entry_city, entry_country_id, entry_gender, entry_company, entry_suburb, entry_zone_id, entry_state) values ('4', '1', 'asdfads', 'asdfasd', 'adsas', 'adsadsf', 'safsad', '223', 'm', '', 'safafs', '1', '')



[TEP STOP]

 

Of course, I've tried with non-garbage data, but I've been trying for so long now that I've stopped taking the time to enter in data that makes sense.

 

I have tried erasing the database and reinstalling the whole thing from scratch, without installing any modules but PWA, and the same thing happens.

 

If I hit refresh and repost data, it then goes on to the next step with blank shipping info.

 

Any ideas?

 

-Chris

Share this post


Link to post
Share on other sites

This thread doesn't really help me. I have read through it but didn't find the answer for the error. Please clarify what I need to do.

Share this post


Link to post
Share on other sites

Read page 18. I included a zip of my files that fixed the problem, although you would need to have Paypal IPN installed or go through and uninstall it from my files. If not in the last two posts in the thread I listed the file edits needed to remove the problem...ya know all the "find this change to this" stuff. The error is caused by the PWA contribution always trying to set the address_id=1, so basically one person can use it and then it breaks down unless you delete the entry from the DB..pain in the butt. There is also code listed earlier in the thread which automatically deletes the info from the DB when the customer reaches the checkout success page. If you don't use Paypal IPN or something else that could lead to the customer not getting to "checkout_success.php" just adding the code posted by Gremlin will fix it.

Share this post


Link to post
Share on other sites

JB, Thanks for the quick reply. The file did fix that problem, however there are several other "problems" that are showing up.

 

1) The right menu is not showing up at all. That is the menu that has the manufacturers and specials...

 

2) In the readme.txt you have to insert a code to remove the logoff if a customer uses the PWA method. I have tried to insert that code in Order_info_process and in the Header.php but still no luck. The logoff option is still displayed.

 

<?php

 if (!tep_session_is_registered('noaccount')) {

echo HEADER_TITLE_LOGOFF;

       }

?>

 

Please let me know how I can help in anyway in fixing these bugs.

Thanks

Share this post


Link to post
Share on other sites

What I did after installing the PWA contrib (which did'nt help) was to change the the customers_id to auto_increment as the first, then address_id not to auto_increment.

 

This worked for me. Might work with others.

 

Worth a try. :D

 

Neil.

Share this post


Link to post
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
Sign in to follow this  

×