Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Deleting a Comment at checkout_confirmation.php


Terra

Recommended Posts

On my shop I had the problem that when a customer clicked the "edit" button on checkout_confirmation.php, deleted the comment and then came back to checkout_confirmation then their comment was still there! It could be over-written but not deleted.

 

To solve this problem I found two possible solutions:

 

1) back up checkout_confirmation.php

 

2) find this code (around line 40):

 

if (!tep_session_is_registered('comments')) tep_session_register('comments');
if (tep_not_null($HTTP_POST_VARS['comments'])) {
$comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);
}

 

3 - 1st Solution) replace with

 

if (!tep_session_is_registered('comments')) tep_session_register('comments');
$comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);

 

 

3- 2nd Solution) replace with

 

if (!tep_session_is_registered('comments')) tep_session_register('comments');
if (tep_not_null($HTTP_POST_VARS['comments'])) {
$comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);
} else { $comments = ''; }

 

Both work on my shop and correctly remove the comment once deleted.

 

Terra :thumbsup:

My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Link to comment
Share on other sites

  • 1 month later...

It checks to see if there are comments first. If there are none ... when the page refreshes it resets the comments to none.

 

If there are comments .. when the page refreshes it will repost the comments.

 

It is a foolproof loop. Works perfect.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...