X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   "Customer notes" access.. (https://forum.x-cart.com/showthread.php?t=35364)

Lukas 11-12-2007 10:45 AM

"Customer notes" access..
 
Hello! I'd like to attach a date picker to the "Customer notes" on the "Check-out" page. Can anybody tell me which file I need to modify? Is it dialog_message.tpl or dialog.tpl? Thank you!

balinor 11-12-2007 10:57 AM

Re: "Customer notes" access..
 
It is customer/main/customer_notes.tpl.

Moving to template editing.

Lukas 11-12-2007 11:09 AM

Re: "Customer notes" access..
 
I don't have this file but I found "order_message.tpl" - is this the correct file?
Thank you!

balinor 11-12-2007 11:15 AM

Re: "Customer notes" access..
 
sorry, it is checkout_notes.tpl

Lukas 11-12-2007 11:21 AM

Re: "Customer notes" access..
 
Thanks a lot!!

Lukas 11-14-2007 10:43 AM

Re: "Customer notes" access..
 
Quote:

Originally Posted by balinor
sorry, it is checkout_notes.tpl


Hello Padraic, Thank you so much for your hint! I tried to implement a date picker but I get the following response. The code is attached. Any idea what my problem is? Your help is really appreciated! ~Jahn

Error: Smarty error: [in customer/main/checkout_notes.tpl line 14]: syntax error: unrecognized tag: minuteDropDownInterval:10,numberOfRowsInHourDropDo wn:5,callbackFunctionOnDayClick:'getDateFromCalend ar',isDragable:true,displayTimeBar:true (Smarty_Compiler.class.php, line 436) in /home/madhatca/public_html/xcart/Smarty-2.6.12/Smarty.class.php on line 1095




{* $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"}

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

<!-- A DATE PICKER FOR FORMS -->

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

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

</table>

balinor 11-14-2007 10:46 AM

Re: "Customer notes" access..
 
If you are using JavaScript in X-Cart, you need to surround it with {literal} tags so Smarty doesn't try to read it:

{literal}
javascript code here
{/literal}

Lukas 11-14-2007 10:53 AM

Re: "Customer notes" access..
 
I followed your advice. The error message is gone. But the calender function doesn't work although it works standalone in html.
Thanks for your great support!

Lukas 11-14-2007 01:08 PM

Re: "Customer notes" access..
 
Quote:

Originally Posted by balinor
If you are using JavaScript in X-Cart, you need to surround it with {literal} tags so Smarty doesn't try to read it:

{literal}
javascript code here
{/literal}


Hi Padraic!
Can you think of any reason why my script won't work?
Thank you. ~Jahn

balinor 11-14-2007 03:29 PM

Re: "Customer notes" access..
 
Sorry, JS is not my specialty :(


All times are GMT -8. The time now is 11:15 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.