Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Contribution 1341 - Agree to Terms Support


Guest

Recommended Posts

The other support thread was invalid, thought a new one could be started.

 

This contribution forces customers to agree to terms & conditions by adding a checkbox at the order confirmation page.

 

I have added version 1.6.7 which merges the javascript disabled and PayPal fixes by Phliplip and red-ray.

 

The contribution can be found here http://www.oscommerce.com/community/contri...,agree+to+terms

Link to comment
Share on other sites

I installed the Agree to Terms Contribution, but when I test it the checkout_confirmation.php page goes blank. Here is my code from ---- catalog/checkout_confirmation.php

 

 

 

<?php

/*

$Id: checkout_confirmation.php,v 1.3 2003/09/30 16:22:42 serg Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

 

// if the customer is not logged on, redirect them to the login page

if (!tep_session_is_registered('customer_id')) {

$navigation->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_PAYMENT));

tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));

}

 

// if there is nothing in the customers cart, redirect them to the shopping cart page

if ($cart->count_contents() < 1) {

tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));

}

 

// avoid hack attempts during the checkout procedure by checking the internal cartID

if (isset($cart->cartID) && tep_session_is_registered('cartID')) {

if ($cart->cartID != $cartID) {

tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));

}

}

 

// if no shipping method has been selected, redirect the customer to the shipping method selection page

if (!tep_session_is_registered('shipping')) {

tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));

}

 

if (!tep_session_is_registered('payment')) tep_session_register('payment');

if (isset($HTTP_POST_VARS['payment'])) $payment = $HTTP_POST_VARS['payment'];

 

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']);

}

 

// load the selected payment module

require(DIR_WS_CLASSES . 'payment.php');

$payment_modules = new payment($payment);

 

require(DIR_WS_CLASSES . 'order.php');

$order = new order;

 

$payment_modules->update_status();

 

if ( ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) ) || (is_object($$payment) && ($$payment->enabled == false)) ) {

tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(ERROR_NO_PAYMENT_MODULE_SELECTED), 'SSL'));

}

 

if (is_array($payment_modules->modules)) {

$payment_modules->pre_confirmation_check();

}

 

// load the selected shipping module

require(DIR_WS_CLASSES . 'shipping.php');

$shipping_modules = new shipping($shipping);

 

require(DIR_WS_CLASSES . 'order_total.php');

$order_total_modules = new order_total;

 

// Stock Check

$any_out_of_stock = false;

if (STOCK_CHECK == 'true') {

for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {

if (tep_check_stock($order->products[$i]['id'], $order->products[$i]['qty'])) {

$any_out_of_stock = true;

}

}

// Out of Stock

if ( (STOCK_ALLOW_CHECKOUT != 'true') && ($any_out_of_stock == true) ) {

tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));

}

}

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_CONFIRMATION);

 

$breadcrumb->add(NAvb script:void(0);" onclick="NewWindow('<?php echo tep_href_link('popup_conditions.php'); ?>','tech','800','600','yes');return false"><u style="main"><u style="main"><?php echo CONDITIONS; ?></u></a></td>

</td>

</tr></table>

</table></td>

</tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">

<tr class="infoBoxContents">

<td align="right"><?php echo tep_image_submit('button_confirm_order.gif', IMAGE_BUTTON_CONFIRM_ORDER); ?></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

</form></table></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td width="50%" align="right"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>

<td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>

</tr>

</table></td>

<td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>

<td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>

<td><?php echo tep_image(DIR_WS_IMAGES . 'checkout_bullet.gif'); ?></td>

<td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>

</tr>

</table></td>

<td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>

<td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>

</tr>

</table></td>

</tr>

<tr>

<td align="center" width="25%" class="checkoutBarFrom"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '" class="checkoutBarFrom">' . CHECKOUT_BAR_DELIVERY . '</a>'; ?></td>

<td align="center" width="25%" class="checkoutBarFrom"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '" class="checkoutBarFrom">' . CHECKOUT_BAR_PAYMENT . '</a>'; ?></td>

<td align="center" width="25%" class="checkoutBarCurrent"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td>

<td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_FINISHED; ?></td>

</tr>

</table></td>

</tr>

</table></td>

<!-- body_text_eof //-->

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- right_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>

<!-- right_navigation_eof //-->

</table></td>

</tr>

</table>

<!-- body_eof //-->

 

<!-- footer //-->

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>

<!-- footer_eof //-->

<br>

</body>

</html>

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

1

 

 

 

 

Code from --- catalog/includes/languages/english/checkout_confirmation.php follows:

 

<?php

/*

$Id: checkout_confirmation.php,v 1.3 2003/09/30 16:27:03 serg Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

define('NAVBAR_TITLE_1', 'Checkout');

define('NAVBAR_TITLE_2', 'Confirmation');

 

define('HEADING_TITLE', 'Order Confirmation');

 

define('HEADING_DELIVERY_ADDRESS', 'Delivery Address');

define('HEADING_SHIPPING_METHOD', 'Shipping Method');

define('HEADING_PRODUCTS', 'Products');

define('HEADING_TAX', 'Tax');

define('HEADING_TOTAL', 'Total');

define('HEADING_BILLING_INFORMATION', 'Billing Information');

define('HEADING_BILLING_ADDRESS', 'Billing Address');

define('HEADING_PAYMENT_METHOD', 'Payment Method');

define('HEADING_PAYMENT_INFORMATION', 'Payment Information');

define('HEADING_ORDER_COMMENTS', 'Comments About Your Order');

define('TEXT_EDIT', 'Edit');

define('CONDITION_AGREEMENT', 'I have read the conditions of use and I agree to them.');

define('CONDITIONS', 'Terms & Conditions');

define('CONDITION_AGREEMENT_ERROR', "Please read our conditions of use and agree to them. If you do not do so, your order will not be processed.");

 

?>

 

1

 

 

Code from --- catalog/includes/languages/english/conditions.php follows:

 

 

<?php

/*

$Id: conditions.php,v 1.3 2003/09/30 16:27:03 serg Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2002 osCommerce

 

Released under the GNU General Public License

*/

 

define('NAVBAR_TITLE', 'Conditions of Use');

define('HEADING_TITLE', 'Conditions of Use');

define('TEXT_INFORMATION', 'Put here your Conditions of Use information.');

define('TEXT_CLOSE_WINDOW', 'Close window');

 

?>

 

 

Sorry for all the code.

I would appreciate the help.

Link to comment
Share on other sites

pimpton-

 

In your catalog/checkout_confirmation file you are missing huge chuncks of code. Did you copy & paste the agree to terms code over your original checkout_confirmation file or did you integrate the code to the original file?

 

The code provided with the agree to terms contribution is not a complete code, it needs to be integrated.

 

HTHs

Link to comment
Share on other sites

pimpton-

 

In your catalog/checkout_confirmation file you are missing huge chuncks of code. Did you copy & paste the agree to terms code over your original checkout_confirmation file or did you integrate the code to the original file?

 

The code provided with the agree to terms contribution is not a complete code, it needs to be integrated.

 

HTHs

 

I integrated the new code. I am going to start over and let you how it goes.

 

Thanks

Link to comment
Share on other sites

pimpton-

 

In your catalog/checkout_confirmation file you are missing huge chuncks of code. Did you copy & paste the agree to terms code over your original checkout_confirmation file or did you integrate the code to the original file?

 

The code provided with the agree to terms contribution is not a complete code, it needs to be integrated.

 

HTHs

 

 

I started over from scratch and the Agree to Terms works perfect. I love this contribution.

 

Thanks for the help.

Link to comment
Share on other sites

  • 2 weeks later...

I have just added this as I thought it would be a great edition. However, I have installed Infobox Manager as well and so when the popup appears it is not pulling up the Terms page which resides in conditions2.php.

 

I have changed the code in cat/checkout confirmation.php to conditions2.php but it still doesn't show the contents.

 

Any ideas?

 

TIA

Link to comment
Share on other sites

  • 1 month later...
  • 1 year later...

Hello,

 

I'm not sure this thread is still active but will try. I use the contribution "Must agree to terms" on checkout_confirmation.php page. I've also added Phliplip's javascript disabled fix but here is a problem. It works fine for customers with javascript enabled but doesn't work if customers have javascript disabled. They can place an order and pay but the order is not recorded and they can't reach the checkout_success page.

 

How can I modify this contribution to prevent redirecting to the payment window unless the agreement box checked?

 

Thanks.

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