andes1 Posted May 20, 2006 Posted May 20, 2006 "I need to enforce customers to enter information on either the Delivery or Payment information pages in the 'Add Comments About your Order' box before they can proceed to Order confirmation. The reason for this is that we need to have some information from the customer about their product choices that would be too complex to include as Attributes, or in any other way. The easiest way to do this (I suspect) is: i) to change the heading of the box from 'Add Comments About YOur Order' to whatever message we wanted - eg 'This is the other information required about my product choices to process the order' ii) to add a javascript warning on the page with a statement that says something like 'I have added the required information', and if the box is not ticked the page returns with an error telling them to add the comments and/or tick the box before they can proceed. Does anyone have any suggestions - either a pointer to a contribution that would do this, or pointers on which script to modify and how. Thanks " originale by pewe
Guest Posted May 20, 2006 Posted May 20, 2006 goto your catalog\checkout_confirmation.php locate this code: if (tep_not_null($HTTP_POST_VARS['comments'])) { $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']); } Then change this to: if (tep_not_null($HTTP_POST_VARS['comments'])) { $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']); } else { $messageStack->add_session('checkout_payment', 'You must enter something in the comments box'); tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'))); } Now in your catalog\checkout_payment.php you need to inform the customer that needs to fill-in the comments box so you add this code: <?php if ($messageStack->size('checkout_payment') ) { ?> <tr> <td><?php echo $messageStack->output('checkout_payment'); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } ?> you add it right before these lines. <?php if (isset($HTTP_GET_VARS['payment_error']) && is_object(${$HTTP_GET_VARS['payment_error']}) && ($error = ${$HTTP_GET_VARS['payment_error']}->get_error())) { ?>
andes1 Posted May 23, 2006 Author Posted May 23, 2006 Sweeeeeet thanks a lot. Only a small correction this PIECE OF CODE is incorrect by ) CODE if (tep_not_null($HTTP_POST_VARS['comments'])) { $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']); } else { $messageStack->add_session('checkout_payment', 'You must enter something in the comments box'); tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'))); } it should be CODE if (tep_not_null($HTTP_POST_VARS['comments'])) { $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']); } else { $messageStack->add_session('checkout_payment', 'You must enter something in the comments box'); tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); } if not, you will have an error. Thanks a lot
Recommended Posts
Archived
This topic is now archived and is closed to further replies.