Jump to content

Archived

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

Terra

Deleting a Comment at checkout_confirmation.php

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

Share this post


Link to post
Share on other sites

hey but why only comment code change on checkout confirmation, if the seller directly clicks on checkout shipping, through the bar image, will be comment be deleted from that page again.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

×