Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Need "Must Agree To Terms" Modification Needed!


JKlingenberg

Recommended Posts

I've installed the "Must Agree to Terms" (View Contribution) contrib and it works flawlessly,

 

I'm hoping someone can help me modify it to my particular needs...

 

I need 3 (three) check boxes that have to be checked prior to check out.

 

Something like:

 

1. Agree to terms of event

2. I'm over 18

3. My Vehicle meets minimum requirements

 

I'm guessing it should not be to hard to just have the contrib verify that ALL THREE boxes are check prior to checkout. The links can all link to the same "Terms Document" so I just need to be able to verify all 3 boxes are checked...

 

Any help would be greatly appreciated....

 

Thanks

Link to comment
Share on other sites

This could be done, but surely you could just stipulate in the text that the person agrees to terms , is over 18 and the vehicle mees requirements, thus only one checkbox for the customer to bother with and they have by checking the box stated that they agree to terms are over 18 and have an a vehicle meeting requirement

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

I agree it could just be 1 box, but my client is very specific that the when a customer registers for an event (the Products), it requires the boxes to be individually acknowledged.

 

They must be over 18,

They won't sue if they get hurt...

Their Vehicle meets the event requirements and state laws....

 

If all 3 are not checked, they can't proceed.

 

I've been able to add the 3 boxes, but if ANY are checked it proceeds. I just need the "if" statement to check all 3 boxes.

Link to comment
Share on other sites

post your code

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

here are the code sections as they are in my page... Except now even with all 3 boxes are checked I can't proceed. Thanks for your help.

 

 IN HEAD AREA

 

<script language="javascript"><!--

 

function rowOverEffect(object) {

if (document.checkout_confirmation.elements[object].parentNode.parentNode.className != 'moduleRowSelected') {

document.checkout_confirmation.elements[object].parentNode.parentNode.className = 'moduleRowOver';

}

}

 

function rowOutEffect(object) {

if (document.checkout_confirmation.elements[object].checked) {

document.checkout_confirmation.elements[object].parentNode.parentNode.className = 'moduleRowSelected';

} else {

document.checkout_confirmation.elements[object].parentNode.parentNode.className = 'infoBoxContents';

}

}

 

function checkboxRowEffect(object) {

document.checkout_confirmation.elements[object].checked = !document.checkout_confirmation.elements[object].checked;

if(document.checkout_confirmation.elements[object].checked) {

document.checkout_confirmation.elements[object].parentNode.parentNode.className = 'moduleRowSelected';

} else {

document.checkout_confirmation.elements[object].parentNode.parentNode.className = 'moduleRowOver';

}

}

 

function check_agree(TheForm) {

if (TheForm.agree.checked) {

return true;

} else {

alert('<?php echo CONDITION_AGREEMENT_ERROR; ?>');

return false;

}

}

 

 

function rowOverEffect(object) {

if (document.age_confirmation.elements[object].parentNode.parentNode.className != 'moduleRowSelected') {

document.age_confirmation.elements[object].parentNode.parentNode.className = 'moduleRowOver';

}

}

 

function rowOutEffect(object) {

if (document.age_confirmation.elements[object].checked) {

document.age_confirmation.elements[object].parentNode.parentNode.className = 'moduleRowSelected';

} else {

document.age_confirmation.elements[object].parentNode.parentNode.className = 'infoBoxContents';

}

}

 

function checkboxRowEffect(object) {

document.age_confirmation.elements[object].checked = !document.age_confirmation.elements[object].checked;

if(document.age_confirmation.elements[object].checked) {

document.age_confirmation.elements[object].parentNode.parentNode.className = 'moduleRowSelected';

} else {

document.age_confirmation.elements[object].parentNode.parentNode.className = 'moduleRowOver';

}

}

 

function check_agree(TheForm2) {

if (TheForm2.agree.checked) {

return true;

} else {

alert('<?php echo CONDITION_AGREEMENT_ERROR; ?>');

return false;

}

}

 

 

function rowOverEffect(object) {

if (document.regs_confirmation.elements[object].parentNode.parentNode.className != 'moduleRowSelected') {

document.regs_confirmation.elements[object].parentNode.parentNode.className = 'moduleRowOver';

}

}

 

function rowOutEffect(object) {

if (document.regs_confirmation.elements[object].checked) {

document.regs_confirmation.elements[object].parentNode.parentNode.className = 'moduleRowSelected';

} else {

document.regs_confirmation.elements[object].parentNode.parentNode.className = 'infoBoxContents';

}

}

 

function checkboxRowEffect(object) {

document.regs_confirmation.elements[object].checked = !document.regs_confirmation.elements[object].checked;

if(document.regs_confirmation.elements[object].checked) {

document.regs_confirmation.elements[object].parentNode.parentNode.className = 'moduleRowSelected';

} else {

document.regs_confirmation.elements[object].parentNode.parentNode.className = 'moduleRowOver';

}

}

 

function check_agree(TheForm3) {

if (TheForm3.agree.checked) {

return true;

} else {

alert('<?php echo CONDITION_AGREEMENT_ERROR; ?>');

return false;

}

}

 

//--></script>

 

 

IN BODY of TEXT STARTING LINE 378

 

<?php

}

?>

</table></td>

</tr>

</table></td>

</tr>

<?php

}

}

?>

<tr>

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

</tr>

<?php

if (tep_not_null($order->info['comments'])) {

?>

<tr>

<td class="main"><?php echo '<b>' . HEADING_ORDER_COMMENTS . '</b> <a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>

</tr>

<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><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td class="main"><?php echo nl2br(tep_output_string_protected($order->info['comments'])) . tep_draw_hidden_field('comments', $order->info['comments']); ?></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

<tr>

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

</tr>

 

<?php

}

?>

<tr>

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

<?php

if (isset($$payment->form_action_url)) {

$form_action_url = $$payment->form_action_url;

} else {

$form_action_url = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL');

}

 

echo tep_draw_form('checkout_confirmation', $form_action_url, 'post', 'onsubmit="return check_agree(this);"');

 

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

echo $payment_modules->process_button();

}

?>

<tr>

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

<tr class="infoBoxContents" onmouseover="rowOverEffect('agree')" onmouseout="rowOutEffect('agree')" onclick="checkboxRowEffect('agree')">

<td class="main" align="right"><b><?php echo CONDITION_AGREEMENT; ?></b> <?php echo tep_draw_checkbox_field('agree','true', false, 'onclick="checkboxRowEffect(\'agree\')"'); ?></td>

</tr>

<tr class="infoBoxContents" onmouseover="rowOverEffect('agree')" onmouseout="rowOutEffect('agree')" onclick="checkboxRowEffect('agree')">

<td class="main" align="right"><b><?php echo AGE_AGREEMENT; ?></b> <?php echo tep_draw_checkbox_field('agree','true', false, 'onclick="checkboxRowEffect(\'agree\')"'); ?></td>

</tr>

<tr class="infoBoxContents" onmouseover="rowOverEffect('agree')" onmouseout="rowOutEffect('agree')" onclick="checkboxRowEffect('agree')">

<td class="main" align="right"><b><?php echo REGS_AGREEMENT; ?></b> <?php echo tep_draw_checkbox_field('agree','true', false, 'onclick="checkboxRowEffect(\'agree\')"'); ?></td>

</tr>

</table></td>

</tr>

Link to comment
Share on other sites

something along this line

If  (TheForm.agree.checked, TheForm2.agree.checked, TheForm3.agree.checked) {
return true;
} else {
alert('<?php echo CONDITION_AGREEMENT_ERROR; ?>');
return false;
}
}

or

If  [(TheForm.agree.checked), (TheForm2.agree.checked), (TheForm3.agree.checked)] {
return true;
} else {
alert('<?php echo CONDITION_AGREEMENT_ERROR; ?>');
return false;
}
}

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

I am not sure if hte codes I have given are even in the correct form as I have not tried them they are there to give thought to you.

 

You may be able to replace all with one

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

A hint for you :-)

 

You are using the same field names for all 3 checkboxes..... maybe it could be an idea to use 3 different names :unsure:

Mark Evans

osCommerce Monkey & Lead Guitarist for "Sparky + the Monkeys" (Album on sale in all good record shops)

 

---------------------------------------

Software is like sex: It's better when it's free. (Linus Torvalds)

Link to comment
Share on other sites

Mark,

 

I know i'm doing something wrong... Unfortunately i have to confess that I'm just a novis at Java and PHP, but that is why i'm here... to learn from the masters...

 

 

Could you (PLEASE) help me identify the "field names" in my script... :unsure: So I can give each box a differnt name... I know i'm just being dense, but this is still VERY new to me... :blink:

Link to comment
Share on other sites

If you email me the file to

 

[email protected]

 

I will take a look for you :)

Mark Evans

osCommerce Monkey & Lead Guitarist for "Sparky + the Monkeys" (Album on sale in all good record shops)

 

---------------------------------------

Software is like sex: It's better when it's free. (Linus Torvalds)

Link to comment
Share on other sites

  • 3 months later...

Great contribution, works to a level for me, I get a java error box popup in IE.

 

I do not get the same error in opera.

 

Here is the error:

 

A Runtime Error Has Occurred.

Do you wish to debug?

Line 330

Error: Object Expected

 

If I click no I get this error:

 

A Runtime Error Has Occurred.

Do you wish to debug?

Line 325

Error: Object Expected

 

If I click no It works and carries through to end of checkout process any help plz.

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