Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Click "I agree" checkbox before allowing purchase.

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #11  
Old 12-06-2005, 11:01 PM
 
teriwinkle teriwinkle is offline
 

Advanced Member
  
Join Date: Aug 2003
Location: Los Angeles
Posts: 63
 

Default Submit buttons not working

I put this code in place as mentioned.. Everything seems to work except the submit button becomes non-functional. It appears after you click I agree to the terms, but you cannot click the submit order button. What could be causing that?



I am using version 3.5.14

Code:
{* $Id: checkout.tpl,v 1.37.2.1 2004/07/19 07:26:50 max Exp $ *} {include file="location.tpl" last_location=$lng.lbl_payment_details} {capture name=checkout_dialog} <form action="cart.php" method=post name=cartform> {if $config.Appearance.show_cart_details eq "Y" or ($config.Appearance.show_cart_details eq "L" and $smarty.get.paymentid ne "" and $smarty.get.mode eq "checkout")} {include file="customer/main/cart_details.tpl"} {else} {include file="customer/main/cart_contents.tpl"} {/if} <HR noshade size=1> {include file="customer/main/cart_totals.tpl"} {if $js_enabled} <a href="javascript: document.cartform.submit()">{include file="buttons/update.tpl"}</a> {else} {include file="submit_wo_js.tpl" value=$lng.lbl_update} {/if} </form> {/capture} {include file="dialog.tpl" title="`$lng.lbl_checkout`: `$lng.lbl_step` `$checkout_step` `$lng.lbl_of` `$total_checkout_steps`" content=$smarty.capture.checkout_dialog extra="width=100%"} {if $smarty.get.mode eq "auth"} {include file="main/error_login_incorrect.tpl"} {/if} {if $payment_data.payment_method ne ""} <h5>{$lng.lbl_payment_method}: {$payment_data.payment_method}</h5> {capture name=dialog} <table border=0 cellpadding=0 cellspacing=0 width=100%> <form action="{$payment_data.payment_script_url}" method=post name=checkout_form> <input type=hidden name=action value="place_order"> <tr><td> <pre> <font> {include file="customer/main/customer_details.tpl"} </font> </pre> <a href="register.php?mode=update&action=cart&paymentid={$s marty.get.paymentid}">{include file="buttons/modify.tpl"}</a> {if $ignore_payment_method_selection eq ""} <div align=right> <a href="cart.php?mode=checkout">{include file="buttons/change_payment_method.tpl"}</a> </div> {/if} {if $error eq 'fields'} <FONT color="red">{$lng.txt_require_cc_fields_error}</FONT> {/if} <input type=hidden name={$XCARTSESSNAME} value={$XCARTSESSID}> {if $payment_data.payment_template ne ""} {include file=$payment_data.payment_template} {/if} {include file="customer/main/checkout_notes.tpl"} <input type=hidden name=payment_method value="{$payment_data.payment_method}"> {$lng.txt_you_are_agree} "{$lng.lbl_terms_n_conditions}" {$lng.lbl_and} "{$lng.lbl_privacy_statement}". <p align=center> {if $js_enabled} <a href="javascript: {if $config.General.check_cc_number eq "Y" and $payment_data.payment_script eq "payment_cc.php" and $config.disable_ccinfo ne "Y"}if(checkCCNumber(document.checkout_form.card_number, document.checkout_form.card_type) && checkExpirationDate(document.checkout_form.card_expire) {if $config.disable_ccinfo ne "C"} && checkCVV2(document.checkout_form.card_cvv2,document.chec kout_form.card_type){/if}){/if} document.checkout_form.submit()">{include file="buttons/submit_order.tpl" style="button"}</a> {else} {include file="submit_wo_js.tpl" value=$lng.lbl_submit_order} {/if} </td></tr> </form> </table> {/capture} {include file="dialog.tpl" title=$lng.lbl_payment_details content=$smarty.capture.dialog extra="width=100%"} {elseif $payment_methods ne ""} {capture name=dialog} <form method=get action="cart.php" name=checkout_form> <table border=0 align=center> {section name=payment loop=$payment_methods} <tr> <td width=1><input type=radio name=paymentid value={$payment_methods[payment].paymentid}{if $payment_methods[payment].is_default eq "1"} checked{/if}></td> <td nowrap>{$payment_methods[payment].payment_method}&nbs p;</td> <td>{$payment_methods[payment].payment_details}</td> </tr> {/section} <input type=hidden name=mode value=checkout> </table> <div align=center> {if $js_enabled} <a href="javascript: document.checkout_form.submit()">{include file="buttons/continue.tpl" style="button"}</a> {else} {include file="submit_wo_js.tpl" value=$lng.lbl_continue} {/if} </div> </form> {/capture} {include file="dialog.tpl" title=$lng.lbl_payment_method content=$smarty.capture.dialog extra="width=100%"} {/if}

Thanks in advance!
__________________
Red Hat Linux/Apache
Reply With Quote
  #12  
Old 12-07-2005, 12:02 AM
 
Realsecurity Realsecurity is offline
 

Senior Member
  
Join Date: Apr 2005
Location: Bexhill
Posts: 128
 

Default

After placing the code as suggested although i had a smarty error this was caused by another mod, once complete the check button works absolutely fine, check yes SUBMIT ORDER button appears, CHECK NO submit button dissapears just like it should.......im using vers 4.13

goto www.realsecurity.co.uk try the checkout and you will see it works just fine!!!
__________________
SURECOM XCART V4.1.8
Reply With Quote
  #13  
Old 12-11-2005, 09:11 PM
 
teriwinkle teriwinkle is offline
 

Advanced Member
  
Join Date: Aug 2003
Location: Los Angeles
Posts: 63
 

Default Problem solved

Okay...my problem was because there is different syntax for version 3.5.10 thent he 4.x version. This is what I needed inside the <div>

Code:
<div align="center"> <tr><td> {if $js_enabled} {include file="buttons/submit_order.tpl" style="button"} {else} {include file="submit_wo_js.tpl" value=$lng.lbl_submit_order} {/if} </td></tr> </table> </div>


It works great now...Thanks for a nice mod!
__________________
Red Hat Linux/Apache
Reply With Quote
  #14  
Old 02-07-2006, 11:20 AM
  2coolbaby's Avatar 
2coolbaby 2coolbaby is offline
 

eXpert
  
Join Date: Sep 2004
Location: TN moving to FL
Posts: 265
 

Default

I have tried both of these methods and no Submit button shows up for me when I click on I Agree. (Checkbox div & radio button). I have 4.0.17 & I am also on a Mac using Safari. That is most likely the reason, but wanted to let you know that this method is preventing Mac users on Safari from purchasing your product. I have too many mac customers to cut them out. Have to find another method of doing this.
__________________
Mary Lee
-------------------
Dinner and a Murder Mystery Games
http://www.dinnerandamurder.com

x-cart version 4.7.5 / Mac OS 10.10.5 and Windows 8/10 sometimes - Ideal Responsive Template
Reply With Quote
  #15  
Old 05-01-2007, 05:14 AM
  caviar's Avatar 
caviar caviar is offline
 

Newbie
  
Join Date: Sep 2006
Posts: 5
 

Default Re: Click "I agree" checkbox before allowing purchase.

Here is another solution.

Display the "I agree" text with a checkbox and the submit button initially. When the customer goes to click the submit button the script below checks to see if the checkbox was checked or not. If so the order goes through else a popup box is displayed telling the customer he/she must agree to the terms and conditons before placing the order.

Code:
{literal} <script language="javascript" type="text/javascript"> function wrapperCheckTerms(formName) { if (checkTermsBox(formName)) { return true; } else { return false; } } function checkTermsBox(formName) { var alertMsg = "You must agree to our Terms and Conditions before placing this order."; if (formName.AgreeToTermsAndConditions.checked) { return true; } else { alert(alertMsg); return false; } } </script> {/literal}

And place this code in the submit button link.

Code:
onclick='return wrapperCheckTerms(checkout_form);'

I've seen most websites operate in this matter. Check out the UPS website to see this in action. Try clicking the 'Track' button without filling out the form and you'll see what happens.

Code:
http://www.ups.com/content/us/en/index.jsx
__________________
X-Cart version 3.5.11
PHP 4.4.4
MySQL server 4.1.21-standard
OS Linux
Perl 5.008007
XML parser (expat) 1.95.6
Reply With Quote
  #16  
Old 07-10-2007, 07:55 AM
  hrothbeorht's Avatar 
hrothbeorht hrothbeorht is offline
 

Senior Member
  
Join Date: May 2007
Posts: 156
 

Default Re: Click "I agree" checkbox before allowing purchase.

Hey there all,

I need to have this or a similar mod to run on my site. I've tried all the variations and none would even display a button of any sort. I think x-cart has evolved past where this mod works as is. I'm hoping that there are some out there that would enjoy reopening this mod for it to work with the latest stable version 4.1.8. I don't necessarily need it to hide/display just a javascript check to verify that a check box is checked.(with an alert box)

hope this catches someones interest!:P

-hroth
__________________
x-cart- 4.1.10
www.boutiquefinn.ca
Reply With Quote
  #17  
Old 07-10-2007, 08:10 AM
 
dave70 dave70 is offline
 

Newbie
  
Join Date: Mar 2007
Posts: 6
 

Default Re: Click "I agree" checkbox before allowing purchase.

check out this thread. I was able to implement this code in just a few minutes.

http://forum.x-cart.com/viewtopic.php?p=129976


If you want to change the text, you can find it in the languages section of your admin.
__________________
XCart - Version 4.1.6 & 4.1.7
Reply With Quote
  #18  
Old 07-10-2007, 09:24 AM
  hrothbeorht's Avatar 
hrothbeorht hrothbeorht is offline
 

Senior Member
  
Join Date: May 2007
Posts: 156
 

Default Re: Click "I agree" checkbox before allowing purchase.

Thanks Dave,
I went through the mod and it works perfectly!
Much much obliged!

-hroth
__________________
x-cart- 4.1.10
www.boutiquefinn.ca
Reply With Quote
  #19  
Old 08-08-2007, 01:03 PM
 
mwar mwar is offline
 

Newbie
  
Join Date: Aug 2007
Posts: 3
 

Default Re: Click "I agree" checkbox before allowing purchase.

I wish I had seen this before the custom modification we purchased with our script.
__________________
X-Cart v. 4.1.8
Reply With Quote
  #20  
Old 11-15-2007, 08:06 AM
 
Lukas Lukas is offline
 

Member
  
Join Date: Oct 2007
Posts: 23
 

Question Re: Click "I agree" checkbox before allowing purchase.

Hello!
I recently tried to implement a date picker within "checkout_notes.tpl". It works perfectly in html but apparently not within tpl. Do I make a very obvious mistake? Attached is the file. Thank you for any hint!! ~Jahn



{* $Id: checkout_notes.tpl,v 1.6 2005/12/07 14:07:21 max Exp $ *}
{include file="customer/main/subheader.tpl" title=$lng.txt_notes class="grey"}

<head>


<link rel="stylesheet" href="{$SkinDir}/cal-2/demos.css" media="screen" type="text/css">

<script type="text/javascript" src="{$SkinDir}/cal-2/dhtmlSuite-common.js"></script>
<script language="javascript" type="text/javascript" src="{$SkinDir}/cal-2/dhtmlSuite-calendar.js"></script>
<script language="javascript" type="text/javascript" src="{$SkinDir}/cal-2/dhtmlSuite-dragDropSimple.js"></script>
<link type="text/css" media="screen" rel="stylesheet" href="{$SkinDir}/cal-2/calendar.css">

</head>
<body>

<!-- A DATE PICKER FOR FORMS -->
{literal}
<script type="text/javascript">
var calendarObjForForm = new DHTMLSuite.calendar({minuteDropDownInterval:10,num berOfRowsInHourDropDown:5,callbackFunctionOnDayCli ck:'getDateFromCalendar',isDragable:true,displayTi meBar:true});
calendarObjForForm.setCallbackFunctionOnClose('myO therFunction');

function myOtherFunction()
{
}
function pickDate(buttonObj,inputObject)
{
calendarObjForForm.setCalendarPositionByHTMLElemen t(inputObject,0,inputObject.offsetHeight+2); // Position the calendar right below the form input
calendarObjForForm.setInitialDateFromInput(inputOb ject,'yyyy-mm-dd hh:ii'); // Specify that the calendar should set it's initial date from the value of the input field.
calendarObjForForm.addHtmlElementReference('myDate ',inputObject); // Adding a reference to this element so that I can pick it up in the getDateFromCalendar below(myInput is a unique key)
if(calendarObjForForm.isVisible()){
calendarObjForForm.hide();
}else{
calendarObjForForm.resetViewDisplayedMonth(); // This line resets the view back to the inital display, i.e. it displays the inital month and not the month it displayed the last time it was open.
calendarObjForForm.display();
}
}
/* inputArray is an associative array with the properties
year
month
day
hour
minute
calendarRef - Reference to the DHTMLSuite.calendar object.
*/
function getDateFromCalendar(inputArray)
{
var references = calendarObjForForm.getHtmlElementReferences(); // Get back reference to form field.
references.myDate.value = inputArray.year + '-' + inputArray.month + '-' + inputArray.day + ' ' + inputArray.hour + ':' + inputArray.minute;
calendarObjForForm.hide();

}
</script>{/literal}



<form name="myForm">
<table cellspacing="0" cellpadding="2">
<tr valign="top">
<td>{$lng.lbl_customer_notes}:</td>
<td>&nbsp;</td>
<td nowrap="nowrap"><textarea cols="70" rows="3" name="Customer_Notes" value="2007-12-24 12:00" onclick="" ></textarea></td>
<td><input value="Pick-up date/time" onclick="pickDate(this,document.forms[0].myDate);" type="button"></td>
</tr>


</table></form>
</body>
__________________
Version 4.1.9
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 12:23 AM.

   

 
X-Cart forums © 2001-2020