X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Remove Terms & Conditions Checkbox for 4.6.1 (https://forum.x-cart.com/showthread.php?t=67889)

kidroush 10-05-2013 03:38 AM

Remove Terms & Conditions Checkbox for 4.6.1
 
I see many posts on how to remove the terms and conditions checkbox on the checkout page for earlier versions of xcart but I don't see how to do so for version 4.6.1.

I am using One Page AJAX checkout. You would think there would be a checkbox in the admin panel to disable this feature?

cflsystems 10-05-2013 08:48 AM

Re: Remove Terms & Conditions Checkbox for 4.6.1
 
No there isn't. The easiest way to do this is to replace the code for it in the template with hidden field and make it checked

kidroush 10-05-2013 09:18 AM

Re: Remove Terms & Conditions Checkbox for 4.6.1
 
Can you provide a little tutorial to do this?

cflsystems 10-05-2013 09:29 AM

Re: Remove Terms & Conditions Checkbox for 4.6.1
 
In skin/common_files/modules/One_Page_Checkout/opc_summary.tpl replace

Code:

  <div class="terms_n_conditions">
    <label for="accept_terms">
      <input type="checkbox" name="accept_terms" id="accept_terms" value="Y" />
      {$lng.txt_terms_and_conditions_note|substitute:"terms_url":"`$xcart_web_dir`/pages.php?alias=conditions":"privacy_url":"`$xcart_web_dir`/pages.php?alias=business"}
    </label>
  </div>


with

Code:


<input type="hidden" name="accept_terms" id="accept_terms" value="Y" />
{*
 <div class="terms_n_conditions">
    <label for="accept_terms">
      <input type="checkbox" name="accept_terms" id="accept_terms" value="Y" />
      {$lng.txt_terms_and_conditions_note|substitute:"terms_url":"`$xcart_web_dir`/pages.php?alias=conditions":"privacy_url":"`$xcart_web_dir`/pages.php?alias=business"}
    </label>
  </div>
*}


kidroush 10-05-2013 09:42 AM

Re: Remove Terms & Conditions Checkbox for 4.6.1
 
It removed the checkbox but now I get a popup error that says you must accept terms and conditions.

cflsystems 10-05-2013 09:44 AM

Re: Remove Terms & Conditions Checkbox for 4.6.1
 
skin/common_files/modules/One_Page_Checkout/opc_init_js.tpl

replace

Code:

  var termsObj = $('#accept_terms')[0];
  if (termsObj && !termsObj.checked) {
    xAlert(txt_accept_terms_err, '', 'W');
    return false;
  }


with

Code:


/*
 var termsObj = $('#accept_terms')[0];
  if (termsObj && !termsObj.checked) {
    xAlert(txt_accept_terms_err, '', 'W');
    return false;
  }
*/


kidroush 10-05-2013 09:48 AM

Re: Remove Terms & Conditions Checkbox for 4.6.1
 
I added checked="checked" and it worked perfect:

PHP Code:

<input type="hidden" name="accept_terms" id="accept_terms" value="Y"  checked="checked" /> 
{*  <
div class="terms_n_conditions">      <label for="accept_terms">       <input type="checkbox"  name="accept_terms" id="accept_terms" value="Y" />        
{
$lng.txt_terms_and_conditions_note|substitute:"terms_url":"`$xcart_web_dir`/pages.php?alias=conditions":"privacy_url":"`$xcart_web_dir`/pages.php?alias=business"}      </label>   </div> *} 


cflsystems 10-05-2013 09:52 AM

Re: Remove Terms & Conditions Checkbox for 4.6.1
 
hidden fields do not have this attribute so technically putting "checked" on it is not correct

kidroush 10-05-2013 01:38 PM

Re: Remove Terms & Conditions Checkbox for 4.6.1
 
Well it got rid of the error message :D
Quote:

Originally Posted by cflsystems
hidden fields do nto have this attribute so technically putting "checked" on it is not correct


carpeperdiem 10-05-2013 04:48 PM

Re: Remove Terms & Conditions Checkbox for 4.6.1
 
You can also use css to hide the div

{ display:none; }

or if you want to preserve the page layout, use

{ visibility:hidden; }

both are useful in their own ways


All times are GMT -8. The time now is 09:11 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.