Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Here is the fix for 2checkout not saving order


am1971

Recommended Posts

After not sleeping the whole night I figured out how to fix the problem that many are having, myself included.

 

Got an email from tech support.

 

So basically the problem is that a customer places an order checks out, there is no record of the order in oscommerce and no product name so we don't know what has been purchased nor what to send.

 

 

Here is how to fix the problem:

 

go to: /catalog/includes/modules/payment/pm2checkout.php

 

Of course you need to back it up before you do any changes.

 

Use a text editor and open pm2checkout.php, look for this section:

$process_button_string"

 

Look between these 2 lines of codes:

 

 

-------------

tep_draw_hidden_field('x_ship_to_country', $order->delivery['country']['title']) . <- dot

-------------

tep_draw_hidden_field('x_email_merchant', ((MODULE_PAYMENT_2CHECKOUT_EMAIL_MERCHANT == 'True') ? 'TRUE' : 'FALSE'));

-------------

 

If you don't have any code between those 2 lines add this missing code:

 

tep_draw_hidden_field('x_receipt_link_url', tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL')) . <-- don't forget the dot

 

so it will look like this:

 

 

tep_draw_hidden_field('x_ship_to_country', $order->delivery['country']['title']) . <-- dot

tep_draw_hidden_field('x_email_merchant', ((MODULE_PAYMENT_2CHECKOUT_EMAIL_MERCHANT == 'True') ? 'TRUE' : 'FALSE'));

tep_draw_hidden_field('x_receipt_link_url', tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL')) . <------ dot

 

Save this updated pm2checkout.php and upload it to the same directory where it was before /catalog/includes/modules/payment/

 

Now once a customer places an order you will get an email which includes a link on your store of what has been purchased.

 

Now let's make sure that the pm2checkout_process.php is correctly setup:

 

It is in /catalog/ get it and open it with a text editor.

 

Make sure that the 2 addresses are setup correctly under:

 

-----

<form name="twocoprocessform" method="POST" action="http://www.mysite.com/catalog/checkout_process.php">

 

Change to

 

<form name="twocoprocessform" method="POST" action="http://www.yoursite.com/catalog/checkout_process.php">

 

and

 

the 2nd address below it change to the same.

 

--------

Under 2checkout admin panel under look and feel make sure that the addresses you enter in pending and approved url start both with http:

 

and both addresses match the pm2checkout_process.php addresses we setup above.

 

So for approved url it should be something like http://www.yoursite.com/catalog/checkout_process.php

 

and pending url

http://www.yoursite.com/catalog/checkout_process.php

 

make sure you know the difference between http and https, if you have an SSL your addresses should start with https if not than just http.

 

Another important think is that direct return must be set to "Off" in order for the information to passed back to your oscommerce server.

 

It took me over 2 weeks to get an answer from 2checkout people and it looks like it is working now after doing 3 tests, the purchase is recorded in oscommerce and I know now the products that were ordered :)

 

Hope will work for you, you can see from my explanation that I do not know PHP so I tried my best to explain it in simple words.

 

Good luck

Link to comment
Share on other sites

Sounds good. Except if you put direct return to "off" it will not go back and record your order in oscommerce unless the customer clicks on the "finished" button on 2co. If they don't do this, you're back to square one.

 

I have set mine up to work fine with the automatic redirect working as well.

Link to comment
Share on other sites

so it will look like this:

tep_draw_hidden_field('x_ship_to_country', $order->delivery['country']['title']) . <-- dot

tep_draw_hidden_field('x_email_merchant', ((MODULE_PAYMENT_2CHECKOUT_EMAIL_MERCHANT == 'True') ? 'TRUE' : 'FALSE'));

tep_draw_hidden_field('x_receipt_link_url', tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL')) .  <------ dot

 

Thank you for sharing I've test it but I find that there is one thing have a little error the missing line should add in the middle as you say otherwise the check out page will be blank it's very important so it should look like this

 

tep_draw_hidden_field('x_ship_to_country', $order->delivery['country']['title']) . <-- dot
tep_draw_hidden_field('x_receipt_link_url', tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL')) . <------ dot   //must add in the middle//
tep_draw_hidden_field('x_email_merchant', ((MODULE_PAYMENT_2CHECKOUT_EMAIL_MERCHANT == 'True') ? 'TRUE' : 'FALSE'));

 

Also I want to run the test mode and to see if it really works but I just couldn't because everytime I enter incorrect credit card number the 2CO will link to the error page ask me to enter again . Can anyone tell me how to do it using test mode ??? Thank you very much for sharing such valuabe stuff !!

Link to comment
Share on other sites

Sounds good. Except if you put direct return to "off" it will not go back and record your order in oscommerce unless the customer clicks on the "finished" button on 2co.  If they don't do this, you're back to square one.

 

I have set mine up to work fine with the automatic redirect working as well.

 

Hi

 

Download PM2checkout from the controbutions

Link to comment
Share on other sites

Thank you for sharing I've test it but I find that there is one thing have a little error    the missing line should add in the middle as you say otherwise the check out page will be blank  it's very important  so it should look like this

 

tep_draw_hidden_field('x_ship_to_country', $order->delivery['country']['title']) . <-- dot
tep_draw_hidden_field('x_receipt_link_url', tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL')) . <------ dot ? //must add in the middle//
tep_draw_hidden_field('x_email_merchant', ((MODULE_PAYMENT_2CHECKOUT_EMAIL_MERCHANT == 'True') ? 'TRUE' : 'FALSE'));

 

Also I want to run the test mode and to see if it really works but I just couldn't because everytime I enter incorrect credit card number the 2CO will link to the error page ask me to enter again . Can anyone tell me how to do it using test mode ???  Thank you very much for sharing such valuabe stuff !!

 

 

Hi

 

Well how I tested it was that I didn't use the test mode, could not use it and gave me errors.

 

I went to Oscommerce and added a dummy product that was worth $0.10, placed an order and used a real credit card, after that just credited back my self from the 2checkout admin area.

Link to comment
Share on other sites

Hi

 

Well how I tested it was that I didn't use the test mode, could not use it and gave me errors.

 

I went to Oscommerce and added a dummy product that was worth $0.10, placed an order and used a real credit card, after that just credited back my self from the 2checkout admin area.

 

I just follow the way you teach me. using the real transcation by dummy products. :however, I just got the error when I click finish the transcation in 2CO it will direct to my website page. However, when they go back to my website page it won't go to the completed process page it will direct to "member login" page ; therefore, the checkout information was save to my database.. ... Oh ~ My ~~ God ~~ what can I do with it ?? I just follow the the excatly same thing as you did. what I did wrong ? I am using the share SSL is that causing the problem ? I am directing the link to " https://www.mysecuresite.com/catalog/checkout_process.php "

or should I using another link instead ? such as " https://www.mysecuresite.com/catalog/checkout_success.php " instead??

or should I turn off my Share SSL function ?

Anyone have a ideas Please it emergency ~~ Thank you for your time !!!

Link to comment
Share on other sites

I just follow the way you teach me. using the real transcation by dummy products. :however, I just got the error when I click finish the transcation in 2CO it will direct to my website page. However, when they go back to my website page it won't go to the completed process page it will direct to  "member login" page ; therefore, the checkout information was save to my database.. ... Oh ~ My ~~ God ~~  what can I do with it ?? I just follow the the excatly same thing as you did. what I did wrong ?  I am using the share SSL is that causing the problem ?  I am directing the  link to  " https://www.mysecuresite.com/catalog/checkout_process.php "

or should I using another link instead ?  such as " https://www.mysecuresite.com/catalog/checkout_success.php "    instead??

or should I turn off my Share SSL function ?

Anyone have a ideas Please it emergency ~~ Thank you for your time !!!

 

Sorry typing mistake I mean the checkout information didn't save into my database !!

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