<?xml version="1.0" encoding="UTF-8"?>
<modification>
	<id>Terms Acceptance</id>
	<version>2.0</version>
	<vqmver required="true">2.4.0</vqmver>
	<author>litecart.net</author>
  
  <file name="includes/templates/*.catalog/views/box_checkout_summary.inc.php">
    <operation error="log">
      <search position="replace"><![CDATA[
            <?php echo language::translate('checkout_summary:terms_of_purchase', 'By proceeding you hereby confirm and accept the Terms and Conditions of Purchase.'); ?>
      ]]></search>
      <add><![CDATA[
        <label class="checkbox">
          <?php echo functions::form_draw_checkbox('terms_acceptance', 'true'); ?>
          <?php echo language::translate('checkout_summary:terms_of_purchase', 'By proceeding you hereby confirm and accept the Terms and Conditions of Purchase.'); ?>
        </label>
      ]]></add>
    </operation>
  </file>
  
  <file name="pages/order_process.inc.php">
    <operation error="log">
      <search position="after"><![CDATA[
    if (isset($_POST['confirm_order'])) {
      ]]></search>
      <add><![CDATA[
      if (empty($_POST['terms_acceptance'])) {
        notices::add('errors', language::translate('error_must_agree_to_terms_and_conditions', 'You must agree to the terms and conditions'));
        header('Location: '. document::ilink('checkout'));
        exit;
      }
      
      ]]></add>
    </operation>
  </file>
  
</modification>