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

Adding additonal confirmation box 2 chkout

Locked
Results 1 to 20 of 34
This thread is locked. New replies are disabled.
19 Jul 2007, 17:21
#1
a_1_electronics avatar

a_1_electronics

Inactive

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

Adding additonal confirmation box 2 chkout

I need to add two additional boxes to step 2 of the checkout process - Payment Information.

There is already a box for cofirming the terms and conditions. I need to add a box for confirming that the customer has read the returns policy and a box that they understand how their credit card will be billed.

I have found the .php page to change the wording. However, I am unable to get the new boxes to show.
19 Jul 2007, 19:03
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Posts:
31,500
Plugin Contributions:
4

Re: Adding additonal confirmation box 2 chkout

Why not include all of this in your terms and conditions and not make it yet another step for your customers to have to complete?
19 Jul 2007, 21:39
#3
a_1_electronics avatar

a_1_electronics

Inactive

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

Re: Adding additonal confirmation box 2 chkout

This is being asked for from my processor. They want to make sure that the customer has been given every opportunity to read the policies and that they indicate that they have in order to minimize charge backs.
20 Jul 2007, 04:59
#4
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Posts:
31,500
Plugin Contributions:
4

Re: Adding additonal confirmation box 2 chkout

What does your code look like and what validation routine have you used?
20 Jul 2007, 16:26
#5
a_1_electronics avatar

a_1_electronics

Inactive

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

Re: Adding additonal confirmation box 2 chkout

Here is the code from checkout_payment.php. I have altered the wording to include everything that the processor wanted in hopes that this will be sufficiant. If it is not, I will still need to add the additional check boxes.

define('TEXT_CONDITIONS_DESCRIPTION', '<span class="termsdescription">Please acknowledge the Conditions of Use and Returns policies bound to this order by ticking the following box. You can view each of these policies by clicking <a href="' . zen_href_link(FILENAME_CONDITIONS, '', 'SSL') . '"><span class="pseudolink">Conditions of Use</span></a> and <a href="' . zen_href_link(FILENAME_RETURNS, '', 'SSL') . '"><span class="pseudolink">Returns</span></a>. You must also confirm that you understand that for your privacy, your credit card will be billed as A-1 Electronics.');
define('TEXT_CONDITIONS_CONFIRM', '<span class="termsiagree">I have read and agreed to the Conditions of Use and to the Returns Policy bound to this order. I am also stating that I understand that my credit card will be billed as A-1 Electronics.</span>');

I don't think I have made any other mods to this file. The code begins around line 32.

As far as validation routines.....HUH? I tried copying the last 'define' section for each addtional box that I wanted to add and change the wording. As you probablly already know, this doen't work.
20 Jul 2007, 20:55
#6
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Posts:
31,500
Plugin Contributions:
4

Re: Adding additonal confirmation box 2 chkout

Have you defined these variables or are these the default defines?

TEXT_CONDITIONS_DESCRIPTION'
(FILENAME_CONDITIONS, '', 'SSL'   
FILENAME_RETURNS, '', 'SSL'
TEXT_CONDITIONS_CONFIRM'

As far as validation routines.....HUH?

How do you determine that the check box has been checked?
20 Jul 2007, 23:18
#7
a_1_electronics avatar

a_1_electronics

Inactive

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

Re: Adding additonal confirmation box 2 chkout

The only thing I did was change the original text. I tried duplicating what I thought was the check box code but that did not work. I have not added any additional code or made any other changes.

So to answer your questions, no I have not defined anything and I do not know how to verify that the box has been checked.
21 Jul 2007, 03:57
#8
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Posts:
31,500
Plugin Contributions:
4

Re: Adding additonal confirmation box 2 chkout

Well ad I thought....using the current code looks at the default check box...

You will need to define another and add function, names, and defines for what ever you call this added one and do a similar check for the box condition but as another check on your name for this one.

Check the files linked for this in create account for a place to start
21 Jul 2007, 20:32
#9
a_1_electronics avatar

a_1_electronics

Inactive

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

Re: Adding additonal confirmation box 2 chkout

Ok. That did not help. I take that back. It did help me get to thinking. I did a search in the developers tool kit and found two files that this section was link to. Checkout_payment.php and tpl_checkout_payment.php. I duplicated the code in tpl_checkout_payment.php and in checkout_payment.php and made some changes. It worked...sort of. But now it will let you complete the transaction without checking any of the boxes. Before, if you did not check the box you could not continue.

Original code for /includes/templates/template_default/templates/tpl_checkout_payment_default.php

<fieldset>
<legend><?php echo TABLE_HEADING_CONDITIONS; ?></legend>
<div><?php echo TEXT_CONDITIONS_DESCRIPTION;?></div>
<?php echo zen_draw_checkbox_field('conditions', '1', false, 'id="conditions"');?>
<label class="checkboxLabel" for="conditions"><?php echo TEXT_CONDITIONS_CONFIRM; ?></label>
</fieldset>


New code for /includes/templates/template_default/templates/tpl_checkout_payment_default.php

<fieldset>
<legend><?php echo TABLE_HEADING_CONDITIONS; ?></legend>
<div><?php echo TEXT_CONDITIONS_DESCRIPTION;?></div>
<?php echo zen_draw_checkbox_field('conditions', '1', false, 'id="conditions"');?>
<label class="checkboxLabel" for="conditions"><?php echo TEXT_CONDITIONS_CONFIRM; ?></label>
<?php echo zen_draw_checkbox_field('returns', '1', false, 'id="returns"');?>
<label class="checkboxLabel" for="returns"><?php echo TEXT_RETURNS_CONFIRM; ?></label>
<?php echo zen_draw_checkbox_field('ccbilling', '1', false, 'id="ccbilling"');?>
<label class="checkboxLabel" for="conditions"><?php echo TEXT_CCBILLING_CONFIRM; ?></label>
</fieldset>


Original code for /includes/languages/english/custom/checkout_payment.php

define('TABLE_HEADING_CONDITIONS', '<span class="termsconditions">Conditions of Use, Returns Policy, and Billing</span>');
define('TEXT_CONDITIONS_DESCRIPTION', '<span class="termsdescription">Please acknowledge the Conditions of Use and Returns policies bound to this order by ticking the following box. You can view each of these policies by clicking <a href="' . zen_href_link(FILENAME_CONDITIONS, '', 'SSL') . '"><span class="pseudolink">Conditions of Use</span></a> and <a href="' . zen_href_link(FILENAME_RETURNS, '', 'SSL') . '"><span class="pseudolink">Returns</span></a>. You must also confirm that you understand that for your privacy, your credit card will be billed as A-1 Electronics.');
define('TEXT_CONDITIONS_CONFIRM', '<span class="termsiagree">I have read and agreed to the Conditions of Use and to the Returns Policy bound to this order. I am also stating that I understand that my credit card will be billed as A-1 Electronics.</span>');


New code for /includes/languages/english/custom/checkout_payment.php

define('TABLE_HEADING_CONDITIONS', '<span class="termsconditions">Conditions of Use, Returns Policy, and Billing</span>');
define('TEXT_CONDITIONS_DESCRIPTION', '<span class="termsdescription">Please acknowledge the Conditions of Use and Returns policies bound to this order by ticking the following box. You can view each of these policies by clicking <a href="' . zen_href_link(FILENAME_CONDITIONS, '', 'SSL') . '"><span class="pseudolink">Conditions of Use</span></a> and <a href="' . zen_href_link(FILENAME_RETURNS, '', 'SSL') . '"><span class="pseudolink">Returns</span></a>. You must also confirm that you understand that for your privacy, your credit card will be billed as A-1 Electronics.');
define('TEXT_CONDITIONS_CONFIRM', '<span class="termsiagree">I have read and agreed to the Conditions of Use and to the Returns Policy bound to this order. I am also stating that I understand that my credit card will be billed as A-1 Electronics.</span>');
define('TEXT_RETURNS_CONFIRM', '<span class="termsiagree">I have read and agreed to the Conditions of Use and to the Returns Policy bound to this order. I am also stating that I understand that my credit card will be billed as A-1 Electronics.</span>');
define('TEXT_CCBILLING_CONFIRM', '<span class="termsiagree">I have read and agreed to the Conditions of Use and to the Returns Policy bound to this order. I am also stating that I understand that my credit card will be billed as A-1 Electronics.</span>');


All three boxes showed up. Two things that I did not like. First and foremost, you can continue without checking any of these boxes now. And second, I would like to add a space between each condition. I know that the wording of the terms is the same for each one. I just wanted to see if it would work first before I did a lot of changes.

And also, when I reverted back to the old .php copies it worked just like before. So I know I am missing something.
21 Jul 2007, 21:02
#10
a_1_electronics avatar

a_1_electronics

Inactive

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

Re: Adding additonal confirmation box 2 chkout

Now that I think about it, that may have been what you where telling me.
21 Jul 2007, 21:12
#11
a_1_electronics avatar

a_1_electronics

Inactive

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

Re: Adding additonal confirmation box 2 chkout

Now I have found additonal files that are attached. They are english.php and header_php.php. If I make changes to these files as well will this accomplish what I am looking for? I can not locate any additional files at this time. But I will keep looking.
21 Jul 2007, 21:45
#12
a_1_electronics avatar

a_1_electronics

Inactive

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

Re: Adding additonal confirmation box 2 chkout

Went back and changed the wording for each of the conditions. No I do need to add a line between each one. And I made changes to english.php and header_php.php. It is still letting me go on without having those two boxes checked. Still searching though.
21 Jul 2007, 21:54
#13
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 meant Now I do need to add a line between each one. And I still can not figure out how to make it manditory that all the boxes must be checked.
:frusty::censored::blink:
21 Jul 2007, 22:38
#14
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Posts:
31,500
Plugin Contributions:
4

Re: Adding additonal confirmation box 2 chkout

Looks like you have made some progress!!!!

How about a url to this so we can see where you are and possibly view your generated source code
21 Jul 2007, 22:55
#15
a_1_electronics avatar

a_1_electronics

Inactive

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

Re: Adding additonal confirmation box 2 chkout

Warning - This site contains adult content.

If you would prefer, I could copy the source code for you. Otherwize, it is adultks.com.
So I am down to needing the last two things: Making sure that the boxes are checked and moving each box to it's own line.
21 Jul 2007, 23:48
#16
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Posts:
31,500
Plugin Contributions:
4

Re: Adding additonal confirmation box 2 chkout

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
22 Jul 2007, 02:43
#17
a_1_electronics avatar

a_1_electronics

Inactive

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

Re: Adding additonal confirmation box 2 chkout

New code for tpl_checkout_payment_default.php

<?php
if (DISPLAY_CONDITIONS_ON_CHECKOUT == 'true') {
?>
<fieldset>
<legend><?php echo TABLE_HEADING_CONDITIONS; ?></legend>
<div><?php echo TEXT_CONDITIONS_DESCRIPTION;?></div>
<div><?php echo zen_draw_checkbox_field('conditions', '1', false, 'id="conditions"');?>
<label class="checkboxLabel" for="conditions"><?php echo TEXT_CONDITIONS_CONFIRM; ?></label>
<div><?php echo zen_draw_checkbox_field('returns', '1', false, 'id="returns"');?>
<label class="checkboxLabel" for="returns"><?php echo TEXT_RETURNS_CONFIRM; ?></label>
<div><?php echo zen_draw_checkbox_field('ccbilling', '1', false, 'id="ccbilling"');?>
<label class="checkboxLabel" for="conditions"><?php echo TEXT_CCBILLING_CONFIRM; ?></label>
</fieldset>


Well, I figured out the spacing. However, I am still unable to force the checkbox. I know you can make this selection in the admin panel to turn conditions on and off. I hope I don't need to make a change in the admin panel.
22 Jul 2007, 02:51
#18
ajeh avatar

ajeh

Oba-san

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

Re: Adding additonal confirmation box 2 chkout

If you peek in the:
/includes/modules/pages/checkout_confirmation/header_php.php

You will notice this test that addes to the message_stack:
[PHP]if (DISPLAY_CONDITIONS_ON_CHECKOUT == 'true') {
if (!isset($_POST['conditions']) || ($_POST['conditions'] != '1')) {
$messageStack->add_session('checkout_payment', ERROR_CONDITIONS_NOT_ACCEPTED, 'error');
}
}
[/PHP]

Further along, you will notice this redirect when the message_stack is > 0:
[PHP]if ($messageStack->size('checkout_payment') > 0) {
zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
}
[/PHP]
22 Jul 2007, 03:13
#19
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 do see that. But I don't understand. Maybe I have made an error.

This is the code and the mod I made in header_php.php:

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

I know I am missing something very simple.
22 Jul 2007, 03:31
#20
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 ($messageStack->size('checkout_payment') > 0) {
zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));


Do I need to change > 0 to >2?


Nope. That doesn't work.

How about if I change the second and third instance of checkout_payment to checkout_payment_2 and checkout_payment_3.