Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Must agree to Terms


M@rcel

Recommended Posts

I'm using MS2 but I'm not getting any validation with this modification. Whether the Must Agree box is checked or not, the user can proceed to the payment page without any error message. I am also using Checkout without Account mod, among others, but I don't see how that would have any effect on this. I really like this mod and would like to use it if anyone could give me an idea how to get the validation script to work. Thanks.

"It's a small world...

But I wouldn't want to paint it!"

Stephen Wright

Link to comment
Share on other sites

Ok, this is what I've done:

 

I downloaded and installed a fresh copy of OSCommerce 2.2ms2.

I downloaded and installed the contribution.

 

Everything works as expected. But:

You need ms2

Javascript must be enabled in your browser

Greetings from Marcel

|Current version|Documentation|Contributions|

Link to comment
Share on other sites

Ok, this is what I've done:

 

I downloaded and installed a fresh copy of OSCommerce 2.2ms2.

I downloaded and installed the contribution.

 

Everything works as expected. But:

You need ms2

Javascript must be enabled in your browser

 

I've just begun converting to MS2.2 so I'll let you know if it works but I was using MS2.1 when I couldn't get the validation. Thank you for the reply.

 

Cheers,

"It's a small world...

But I wouldn't want to paint it!"

Stephen Wright

Link to comment
Share on other sites

Just to make sure we are talking about the same thing here:

 

You need OSCommerce 2.2MS2 (released today!)

 

Correct. As I said, I just started converting from 2.2MS1 to 2.2MS2 today, so I'll let you know. Thanks again.

 

Cheers,

"It's a small world...

But I wouldn't want to paint it!"

Stephen Wright

Link to comment
Share on other sites

I just did a clean install of 2.2MS2 and this was the first mod I put in. Followed all your directions exactly. Also, I do have JavaScript enabled in my IE6 as well as NS 7x browsers.

 

I went directly to the Paysystems payment screen, even though I never ticked the agree to terms box. Any ideas? Thanks.

"It's a small world...

But I wouldn't want to paint it!"

Stephen Wright

Link to comment
Share on other sites

It happens with either one of them. I've looked into this more carefully and think I see now what is happening. The Paysystems module, unlike some of the other payment methods, such as the CC module or the Authorize.net mod, does NOT do credit card validation at the osC site. Rather, once you've chosen the payment method, your purchase values are transferred directly to the Paysystems secure checkout where you THEN enter your CC or Check info. For security purposes, I actually prefer this as I never have posession of the client's CC info and everything from this point is handled completely independently by Paysysetems.

 

Unfortunately, it looks like the point where your mod kicks in is AFTER this point because if I just use the Credit Card payment module supplied with osC, I do get the validation error if I do not check the Agreement box.

 

I wonder if you might have an idea how to modify your mod's behavior so that the agreement is required earlier in the process? Thanks at any rate for your help.

 

Cheers,

Stretchr

"It's a small world...

But I wouldn't want to paint it!"

Stephen Wright

Link to comment
Share on other sites

O.K. I promised Marcel a confession, so here it is. I've been using a contribution by someone else that has virtually the same name as Marcel's Must Agree to Terms. When I had problems and searched the forums, I came upon this thread. Since that author didn't bother to put his/her name in the readme file, I assumed this was a thread for the mod I was trying to use.

 

Bottom line, Marcel was very gracious and patient and once we realized I was not actually using his modification, I downloaded the mod by Marcel and it worked the first time with no problems.

 

I know, RTFM! But I did read it! But when authors don't bother to include their names in the docs, it's easy to make a mistake. Of course, the other lesson is that it doesn't hurt to be patient with people, even if their mistakes appear to be rather stupid!

:oops:

:oops:

:oops:

Thanks Marcel!

:D

 

Cheers,

Stretchr

"It's a small world...

But I wouldn't want to paint it!"

Stephen Wright

Link to comment
Share on other sites

  • 1 month later...

That looks good thanks :)

 

another question.... could this be changed so that if I have the purchase without acct mod installed they have to agree before purchase, but if they have an acct they only have to when making acct?

Angela

Link to comment
Share on other sites

  • 5 months later...

I've installed the 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

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 boxes are checked...

 

Anu help would be greatly appreciated....

 

Thanks

Link to comment
Share on other sites

  • 2 weeks later...

I've just been pulling my hair out for three hours over this one, so I thought I'd post the solution in case anyone else has this problem ...

 

If you find you *can* checkout without ticking the 'Agree' box, and you can't see any errors in the way you've added the mod (and it is sooo very simple... :rolleyes: ) then make sure you haven't forgot to add a backslash before an apostrophe (\') in any changes you've made to the error text in catalog/includes/languages/english/checkout_confirmation.php. Miss one backslash before an apostrophe and it will happily go through checkout without the 'Agree' box being ticked...

 

Code is weird sometimes...

 

Caught me out...

 

:rolleyes:

Link to comment
Share on other sites

  • 4 months later...

Hey Marcel,

 

I'm getting a javascript error on my checkout_confirmation page. It still functions, and the page opens fine. The checkbox works perfectly. But I'd rather not have an error on page Icon showing up.

 

Line:213
Char:1
Error: Object expected
Code:0
URL:http://localhost/vimax/cart/checkout_confirmation.php

 

Here is the javascript added from your contrib:

<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;
?}
}
var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',
left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}
//--></script>

 

Here is the section added below:

 

<?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" ?onclick="checkbox('agree')">
? ? ? ? ? ? ? ?<td class="main" align="right"><b><?php echo CONDITION_AGREEMENT; ?></b>
? ?
? ?<a href="javascript:void(0);" onclick="NewWindow('popup_conditions.php','tech','800','600','yes');return false"><b 
style="main"><?php echo CONDITIONS; ?></b></a>
? ?
? ?<?php echo tep_draw_checkbox_field('agree','true', false, 'onclick="
checkbox(\'agree\')"'); ?></td>
? ? ? ? ? ? ?</tr>
? ? ? ? ? ?</table></td>
? ? ? ? ?</tr>

 

I changed the size of the windows and the scroll, but other than that nothing was touched. I read through all the posts and didn't see where anyone else was having this issue , so I must have missed something.

 

Java is certainly not my strongest area. <_<

 

Thanks for the help.

 

Vince

Edited by VMax
Link to comment
Share on other sites

  • 2 weeks later...

The TEXT_CLOSE_WINDOW still doesn't work right in the latest revision; it looks like the TEXT_CLOSE_WINDOW definition should go into the conditions.php file rather than the checkout_confirmation.php file in the languages directory.

 

(in fact that's where I put it and it works fine now)

 

Any idea of how to do this but require a person to put in their initials rather than just click a checkbox (not that it would matter in the event of a chargeback but who knows)?

Link to comment
Share on other sites

Hi,

 

Great contrib! Just have one issue..

 

I have a problem that seems to only occur in IE when force cookies = false.

 

If you click the link to view the popup conditions, close using the link at the bottom then tick the box to say you agree, then hit continue it takes you back to the login page.

 

Any ideas what this could be? It seems maybe the act of the pop up window is causing osd to forget the session?

 

Seems to be fine in mozilla.

 

Any help/ideas would be appreciated!

 

Cheers

 

Damo

Link to comment
Share on other sites

  • 8 months later...
If you find you *can* checkout without ticking the 'Agree' box, and you can't see any errors in the way you've added the mod (and it is sooo very simple...  :rolleyes: ) then make sure you haven't forgot to add a backslash before an apostrophe (\') in any changes you've made to the error text in catalog/includes/languages/english/checkout_confirmation.php. Miss one backslash before an apostrophe and it will happily go through checkout without the 'Agree' box being ticked...

 

So, I thought, that's gotta be my problem. So I went and looked but there were no apostrophies in my error text. BUT, I noticed something else:

 

The following line is to be added to the catalog/includes/languages/english/checkout_confirmation.php file:

 

define('CONDITION_AGREEMENT_ERROR', "Please read our conditions of use and agree to them. If you do not do so, your order will not be processed.");

 

There are double quotes in the text. Shouldn't be there. So I changed them to single quotes and was sure this was the fix! Nope. I still get verified without checking the box.

 

I have the correct version of osC and have followed instructions carefully (like I've learned I must by installing many contributions). I just don't get it.

Any clues out there?

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