Forums / Templates, Stylesheets, Page Layout / Adding additonal confirmation box 2 chkout

Adding additonal confirmation box 2 chkout

Locked

Started by a_1_electronics on 19 Jul 2007, 5:21 PM · Views: 4,838

Results 21 to 34 of 34
This thread is locked. New replies are disabled.
22 Jul 2007, 3:56 AM
#21
a_1_electronics avatar

a_1_electronics

Inactive

Join Date:
Apr 2007
Posts:
117
Plugin Contributions:
0

Adding additonal confirmation box 2 chkout

That wouldn't work either. I have been working on this problem for several days now and most of today. My mind is fogging over.

22 Jul 2007, 4:11 AM
#22
a_1_electronics avatar

a_1_electronics

Inactive

Join Date:
Apr 2007
Posts:
117
Plugin Contributions:
0

Re: Adding additonal confirmation box 2 chkout

kobra:

Without my stepping through each step of this i used the developers tool kit and searched for "NOT_ACCEPTED"

the following is from source of one of my sites:

<fieldset> <legend><span class="termsconditions">Terms and Conditions</span></legend> <div><span class="termsdescription">Please acknowledge the terms and conditions bound to this order by ticking the following box. The terms and conditions can be read <a href="http://www.mysite.com/index.php?main_page=conditions"><span class="pseudolink">here</span></a>.</div> <input type="checkbox" name="conditions" value="1" id="conditions" /><label class="checkboxLabel" for="conditions"><span class="termsiagree">I have read and agreed to the terms and conditions bound to this order.</span></label> </fieldset> ``` > and the code for validation is in /includes/modules/pages/checkout_confirmation/header_php.php and is as follows: > ``` if (DISPLAY_CONDITIONS_ON_CHECKOUT == 'true') { if (!isset($_POST['conditions']) || ($_POST['conditions'] != '1')) { $messageStack->add_session('checkout_payment', ERROR_CONDITIONS_NOT_ACCEPTED, 'error'); } ``` > Now you need to replicate at least this for each of your new check boxes and of course change the if to the new box defines. > The initial "if" refers to a condition set in the admin and this is another whole bag of code and if all other things are covered you might just omit these for your added boxes > ``` if (DISPLAY_RETURNS_ON_CHECKOUT == 'true') { and if (DISPLAY_CCBILLING_ON_CHECKOUT == 'true') { ``` > I assumed that you have defined a class for each of the added boxes but your source does not indicate that you have and this should be in the tpl_ file for this and you can also add a clear both between statements there. > This should get you closer Each of the class= are the same

class="termsiagree'

So I guess I didn't?

22 Jul 2007, 4:20 AM
#23
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Adding additonal confirmation box 2 chkout

Where do you set:
DISPLAY_RETURNS_ON_CHECKOUT
DISPLAY_CCBILLING_ON_CHECKOUT

to be true?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

22 Jul 2007, 2:16 PM
#24
a_1_electronics avatar

a_1_electronics

Inactive

Join Date:
Apr 2007
Posts:
117
Plugin Contributions:
0

Re: Adding additonal confirmation box 2 chkout

If I was to have to guess...I would think probably somewhere on the admin side. Simular to having to set admin-config-regulations-Confirm Terms and Conditions During Checkout Procedure. But I haven't figured out how to add the new regulations...yet.

22 Jul 2007, 2:56 PM
#25
a_1_electronics avatar

a_1_electronics

Inactive

Join Date:
Apr 2007
Posts:
117
Plugin Contributions:
0

Re: Adding additonal confirmation box 2 chkout

I have asked a simular question before when I asked about trying to make sure the individual is at least 18.

Old code for Age Reqirement in create_account.php

if (ACCOUNT_DOB == 'true') {
if (ENTRY_DOB_MIN_LENGTH > 0 or !empty($_POST['dob'])) {
if (substr_count($dob,'/') > 2 || checkdate((int)substr(zen_date_raw($dob), 4, 2), (int)substr(zen_date_raw($dob), 6, 2), (int)substr(zen_date_raw($dob), 0, 4)) == false) {
$error = true;
$messageStack->add('create_account', ENTRY_DATE_OF_BIRTH_ERROR);
}
}
}

New code

if (ACCOUNT_DOB == 'true') {
if (ENTRY_DOB_MIN_LENGTH > 0 or !empty($_POST['dob'])) {
if (substr_count($dob,'/') > 2 || checkdate((int)substr(zen_date_raw($dob), 4, 2), (int)substr(zen_date_raw($dob), 6, 2), (int)substr(zen_date_raw($dob), 0, 4)) == false) {
$error = true;
$messageStack->add('create_account',

ENTRY_DATE_OF_BIRTH_ERROR);
}
$minimum_age = 18;
$acceptable_dob = (date('Y') - $minimum_age) . date('md');
if (zen_date_raw($dob) > $acceptable_dob) {
$error = true;
$messageStack->add('create_account', ENTRY_DATE_OF_BIRTH_UNDERAGE);
}
}
}

Is this simular to what I would need to do with
if (DISPLAY_RETURNS_ON_CHECKOUT == 'true') {
if (!isset($_POST['returns']) || ($_POST['returns'] != '1')) {
$messageStack->add_session('checkout_payment', ERROR_RETURNS_NOT_ACCEPTED, 'error');
}
}

and

if (DISPLAY_CCBILLING_ON_CHECKOUT =='true') {
if (!isset($_POST['ccbilling']) || ($_POST['ccbilling'] != '1')) {
$messageStack->add_session('checkout_payment', ERROR_CCBILLING_NOT_ACCEPTED, 'error');
}
}

22 Jul 2007, 6:51 PM
#26
a_1_electronics avatar

a_1_electronics

Inactive

Join Date:
Apr 2007
Posts:
117
Plugin Contributions:
0

Re: Adding additonal confirmation box 2 chkout

I know I am confusing myself. I have found other threds that refer to jscript files and a few others. But nothing that seems to be helping. The checkboxes are in place and worded correctly. As I have stated before, this is a requirement from my merchant processor before they will approve my account. Even a little clue as to where I need to validate the checkbox would be great. I tried looking for where the box for CONDITIONS is confirmed by doing a search in the developers tool kit. That didn't turn up anything. I'll try some more searches. :frusty:

22 Jul 2007, 7:39 PM
#27
a_1_electronics avatar

a_1_electronics

Inactive

Join Date:
Apr 2007
Posts:
117
Plugin Contributions:
0

Re: Adding additonal confirmation box 2 chkout

I am thinking it has to be in a jscript file somewhere.

22 Jul 2007, 8:06 PM
#28
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Adding additonal confirmation box 2 chkout

Add this:
define('DISPLAY_CONDITIONS_ON_CHECKOUT', 'true');

Right above where you have:

if (DISPLAY_CONDITIONS_ON_CHECKOUT == 'true') {
  if (!isset($_POST['conditions']) || ($_POST['conditions'] != '1')) {
    $messageStack->add_session('checkout_payment', ERROR_CONDITIONS_NOT_ACCEPTED, 'error');
  }
}  

Does it start to work?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

22 Jul 2007, 8:36 PM
#29
a_1_electronics avatar

a_1_electronics

Inactive

Join Date:
Apr 2007
Posts:
117
Plugin Contributions:
0

Re: Adding additonal confirmation box 2 chkout

Nope. That didn't work. I am still getting the same results. I can select the box for confirming the terms and conditions and not the other two boxes. And it will still allow me to continue. If I do not select the terms box I receive the error.

P.S.
Thank you for all your help. Please excuse my frustrations. I am truely tring to understand.

22 Jul 2007, 9:29 PM
#30
a_1_electronics avatar

a_1_electronics

Inactive

Join Date:
Apr 2007
Posts:
117
Plugin Contributions:
0

Re: Adding additonal confirmation box 2 chkout

I have moded 3 files in order to get this far. The one thing I haven't been able to figure out or locate in any file is how zc checks that the customer has placed a checkmark in the box argeeing to the terms. In the admin - config - regs there is a way to turn this on and off. How indepth would it be add additional regulations to the admin panel?

22 Jul 2007, 11:34 PM
#31
a_1_electronics avatar

a_1_electronics

Inactive

Join Date:
Apr 2007
Posts:
117
Plugin Contributions:
0

Re: Adding additonal confirmation box 2 chkout

Found this in tpl_checkout_payment_default.php. does this have to do with validating the check box for the terms?

?>

<?php echo $payment_modules->javascript_validation(); ?> <div class="centerColumn" id="checkoutPayment"> <?php echo zen_draw_form('checkout_payment', zen_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'), 'post', ($flagOnSubmit ? 'onsubmit="return check_form();"' : '')); ?>
23 Jul 2007, 3:28 AM
#32
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Adding additonal confirmation box 2 chkout

What is this constant defined as and where:
ERROR_RETURNS_NOT_ACCEPTED

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

23 Jul 2007, 2:25 PM
#33
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Adding additonal confirmation box 2 chkout

These are the changes I made to make a Returns Checkbox on checkout_payment work and have to be checked ...

While these could be set elsewhere, for now, the easiest method was to add a file to hold the new defines so this can work in:
/includes/extra_datafiles/extra_checkbox_stuff.php

<?php
  define('ERROR_RETURNS_NOT_ACCEPTED', 'CHECK THE RETURNS BOX');
  define('DISPLAY_RETURNS_ON_CHECKOUT', 'true');
  define('TEXT_RETURNS_DESCRIPTION', 'Check the RETURNS box');
  define('TEXT_RETURNS_CONFIRM', 'RETURNS confirm');
?>

Then in the file tpl_checkout_payment_default.php I added below the Conditions checkbox code:

<?php
  if (DISPLAY_RETURNS_ON_CHECKOUT == 'true') {
?>
<fieldset>
<legend><?php echo TABLE_HEADING_RETURNS; ?></legend>
<div><?php echo TEXT_RETURNS_DESCRIPTION;?></div>
<?php echo  zen_draw_checkbox_field('returns', '1', false, 'id="returns"');?>
<label class="checkboxLabel" for="returns"><?php echo TEXT_RETURNS_CONFIRM; ?></label>
</fieldset>
<?php
  }
?>

Then in the file:
/includes/modules/pages/checkout_confirmation/header_php.php

if (DISPLAY_RETURNS_ON_CHECKOUT == 'true') {
  if (!isset($_POST['returns']) || ($_POST['returns'] != '1')) {
    $messageStack->add_session('checkout_payment', ERROR_RETURNS_NOT_ACCEPTED, 'error');
  }
}

This is just below the CONDITIONS code ...

Now the Returns checkbox must be checked or I cannot check out ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

23 Jul 2007, 5:36 PM
#34
a_1_electronics avatar

a_1_electronics

Inactive

Join Date:
Apr 2007
Posts:
117
Plugin Contributions:
0

Re: Adding additonal confirmation box 2 chkout

Thankyou so much. I will add this information and check it out. It may take a little while. I think my power supply went out on my desktop. Which, of course, is where I work on my site.