Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

"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

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 weeks later...

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.

Link to comment
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

Link to comment
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.

Link to comment
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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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