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

Grr...

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 10-27-2002, 07:54 PM
 
japanchick japanchick is offline
 

Advanced Member
  
Join Date: Oct 2002
Posts: 64
 

Default Grr...

Ok Ive spent the past hr updating my site and there are two things I cannot get done:

1) I want to eliminate the some contact fields in the contact list. I went to the contactus.tpl and delete some stuff....I tested it out and is says "email address is not vaild" but I swear, I never touched the email code in the contactus.tpl! Here is the code for it:
Code:
{* $Id: contactus.tpl,v 1.15 2002/09/12 10:25:45 verbic Exp $ *} {literal} <script> function checkEmailAddress(field) { var goodEmail = field.value.match(/b(^(S+@).+((.com)|(.net)|(.edu)|(.mil)|(.gov)|(.org)|(..{2,2}))$)b/gi); if (goodEmail) { return true; } else { alert("E-mail address is invalid! Please correct"); field.focus(); field.select(); return false; } } </script> {/literal} {if $smarty.get.mode eq "update"} {$lng.txt_contact_us_header} {/if} {capture name=dialog} {if $smarty.get.mode eq "update"} <table width=100% border=0 cellspacing=0 cellpadding=2> <form action="help.php?section=contactus&mode=update&action=contactus" method=post name=registerform> <tr valign=middle> <td class="TableCenterCustomerForm">{$lng.lbl_title}</td> <td><font class=StarStyle>*</font></td> <td nowrap> <select name=title> {section name=title loop=$name_titles} <option {if $userinfo.title eq $name_titles[title]}selected{/if}>{$name_titles[title]}</option> {/section} </select> </td> </tr> <tr valign=middle> <td class="TableCenterCustomerForm">{$lng.lbl_first_name}</td> <td><font class=StarStyle>*</font></td> <td nowrap> <input type=text name=firstname size=32 maxlength=32 value="{$userinfo.firstname}"> {if $fillerror ne "" and $userinfo.firstname eq ""}<font class=StarStyle>&lt;&lt;</font>{/if} </td> </tr> <tr valign=middle> <td class="TableCenterCustomerForm">{$lng.lbl_last_name}</td> <td><font class=StarStyle>*</font></td> <td nowrap> <input type=text name=lastname size=32 maxlength=32 value="{$userinfo.lastname}"> {if $fillerror ne "" and $userinfo.lastname eq ""}<font class=StarStyle>&lt;&lt;</font>{/if} </td> </tr> <tr valign=middle> <td class="TableCenterCustomerForm">{$lng.lbl_email}</td> <td><font class=StarStyle>*</font></td> <td nowrap> <input type=text name=email size=32 maxlength=128 value="{$userinfo.email}"> {if $fillerror ne "" and $userinfo.email eq ""}<font class=StarStyle>&lt;&lt;</font>{/if} </td> </tr> <tr valign=middle> <td class="TableCenterCustomerForm">{$lng.lbl_subject}</td> <td><font class=StarStyle>*</font></td> <td nowrap> <input type=text name=subject size=32 maxlength=128 value="{$userinfo.subject}"> {if $fillerror ne "" and $userinfo.subject eq ""}<font class=StarStyle>&lt;&lt;</font>{/if} </td> </tr> <tr valign=middle> <td class="TableCenterCustomerForm">{$lng.lbl_message}</td> <td><font class=StarStyle>*</font></td> <td nowrap> <textarea cols=48 rows=12 name=body>{$userinfo.body}</textarea> {if $fillerror ne "" and $userinfo.body eq ""}<font class=StarStyle>&lt;&lt;</font>{/if} </td> </tr> <tr valign=middle> <td></td> <td></td> <td nowrap> {include file="buttons/submit.tpl"} </td> </tr> <input type=hidden name=usertype value="{$usertype}"> </form> </table> {else} {$lng.txt_contact_us_sent} {/if} {/capture} {include file="dialog.tpl" title=$lng.lbl_contact_us content=$smarty.capture.dialog extra="width=100%"}

2) when placing an order, the email comes back as:

Quote:
This is order 1 notification. Order id: #1 Order date: 27.10.2002 20:28 Order status: Q Customer info: --------------------- Username: anonymous6 First Name: John Last Name: Smith Billing Address: ---------------- Address: 12 asdasd City: asdad State: AB Country: UY Zip code: adasdsad Shipping Address: ----------------- Address: 12 asdasd City: asdad State: AB Country: UY Zip code: adasdsad Phone: 123123 Fax: Fax: shammy@yahoo.com URL: Credit card information: ------------------------ Customer Notes : Products ordered: ----------------- SKU: 1152034573 Product: Glam Chic Punk Plaid Jacket Quantity: 1 Item price: $ 55.00 Total: ------- Payment method: International Money Order Delivery: Canada Post International Subtotal: $ 55.00 Discount: $ 0.00 Coupon saving: $ 0.00 () Shipping cost: $ 14.50 Tax: $ 0.00 Total: $ 69.50 -- Thank you for shopping at Glamour-Hut.com! Phone: (455) 456-4554
URL: http://www.xxx.xxx

all in one big paragraph - how do I organize it?

Thanks so much - Im almost done! yah!
Reply With Quote
  #2  
Old 10-27-2002, 08:53 PM
 
japanchick japanchick is offline
 

Advanced Member
  
Join Date: Oct 2002
Posts: 64
 

Default oh yes

Regarding the question about the email,

I am using Sendmail on linux if that is important at all =)
Reply With Quote
  #3  
Old 10-27-2002, 10:44 PM
 
syddos syddos is offline
 

eXpert
  
Join Date: Sep 2002
Location: London, England, UK
Posts: 259
 

Default

Hi,

Quote:
<script>
function checkEmailAddress(field) {
var goodEmail = field.value.match(/b(^(S+@).+((.com)|(.net)|(.edu)|(.mil)|(.gov)|(.or g)|(..{2,2}))$)b/gi);

if (goodEmail) {
return true;
} else {
alert("E-mail address is invalid! Please correct");

When you tested your "Contact Us" form, did you enter an email address? If not you will get the "Email Address Invalid" error message; this is one of the mandatory fields.

Your Question No 2; Not sure will check.

Regards,
__________________
Syddos

Nothing is impossible, We just don't know how to do it ........Yet!

Xcart 4.1.X PRO (Testing Platform: winXP Pro)
Perl 5.8.7 (win32)
WINAMP 1.6.3 (win32 server package. Includes the following)
- phpMyAdmin v2.8.03
- MySql 5.0.21
- Apache 2.0.55 (win32)
- php 5.1.4
- SQLitemanager 1.2.0
Reply With Quote
  #4  
Old 10-28-2002, 01:55 AM
  seaCOAST's Avatar 
seaCOAST seaCOAST is offline
 

X-Adept
  
Join Date: Oct 2002
Location: New Hampshire
Posts: 569
 

Default

hmm...if HTML mail is selected in general settings, won't the cart send emails without line-breaks? (if that's the correct terminology)
__________________
Xcart V4.5.5 Gold
seaCOAST
"Live FREE or DIE!"
Reply With Quote
  #5  
Old 10-28-2002, 04:12 AM
 
japanchick japanchick is offline
 

Advanced Member
  
Join Date: Oct 2002
Posts: 64
 

Default hi!

Hi,

For the contact Us, I did enter a valid email address, but that screen saying I didnt keeps poping up.

Thanks!
Reply With Quote
  #6  
Old 10-28-2002, 06:40 AM
 
syddos syddos is offline
 

eXpert
  
Join Date: Sep 2002
Location: London, England, UK
Posts: 259
 

Default

Quote:
Originally Posted by Japanchick
1) I want to eliminate the some contact fields in the contact list. I went to the contactus.tpl and delete some stuff....I tested it out and is says "email address is not vaild" but I swear, I never touched the email code in the contactus.tpl! Here is the code for it:

Hi Japanchick,

I had to remove some the fields also, and ran into problems, I always use

around any code I'm planning to delete, untill I know it's working.

I found the answer by tracing the php files, from the "Contact Us" link.
In the file /include/help.php, you will see the following text:-
Quote:
$fillerror = (empty($contact["firstname"]) || empty($contact["lastname"]) || empty($contact["b_address"]) || empty($contact["b_city"]) || empty($contact["b_country"]) || empty($contact["b_zipcode"]) || empty($contact["phone"]) || empty($contact["email"]) || empty($contact["subject"]) || empty($contact["body"]));

I copied the original text into notepad (just to be safe), and changed the original text, to error check only the items I required in the contact list as below:-
Quote:
$filerror = (empty($contact["firstname"]) || empty($contact["lastname"]) || empty($contact["email"]) || empty($contact["subject"]) || empty($contact["body"]));

Now everything works OK, no errors being reported.

I left the original entry in this file, incase I changed my mind about all the items I deleted. The code is one continous line, so it only required one# to dissable it.


Regards,
__________________
Syddos

Nothing is impossible, We just don't know how to do it ........Yet!

Xcart 4.1.X PRO (Testing Platform: winXP Pro)
Perl 5.8.7 (win32)
WINAMP 1.6.3 (win32 server package. Includes the following)
- phpMyAdmin v2.8.03
- MySql 5.0.21
- Apache 2.0.55 (win32)
- php 5.1.4
- SQLitemanager 1.2.0
Reply With Quote
  #7  
Old 10-28-2002, 09:57 AM
 
japanchick japanchick is offline
 

Advanced Member
  
Join Date: Oct 2002
Posts: 64
 

Default hi!

Ok, I changed the help.php as you send...but it still says that the email address I entered - which was jenwyndham@yahoo.com is still invaild. If I restore the contactus.tpl, that email address works fine. But if I modify the contactus.tpl file such that the "Title, First Name, Last Name, Email Adress, Subject, and Message" fields are the only ones there, I get a pop up screen saying "email address is unvalid". Here is the modified contactus.tpl I used
Code:
{* $Id: contactus.tpl,v 1.15 2002/09/12 10:25:45 verbic Exp $ *} {literal} <script> function checkEmailAddress(field) { var goodEmail = field.value.match(/b(^(S+@).+((.com)|(.net)|(.edu)|(.mil)|(.gov)|(.org)|(..{2,2}))$)b/gi); if (goodEmail) { return true; } else { alert("E-mail address is invalid! Please correct"); field.focus(); field.select(); return false; } } </script> {/literal} {if $smarty.get.mode eq "update"} {$lng.txt_contact_us_header} {/if} {capture name=dialog} {if $smarty.get.mode eq "update"} <table width=100% border=0 cellspacing=0 cellpadding=2> <form action="help.php?section=contactus&mode=update&action=contactus" method=post name=registerform> <tr valign=middle> <td class="TableCenterCustomerForm">{$lng.lbl_title}</td> <td><font class=StarStyle>*</font></td> <td nowrap> <select name=title> {section name=title loop=$name_titles} <option {if $userinfo.title eq $name_titles[title]}selected{/if}>{$name_titles[title]}</option> {/section} </select> </td> </tr> <tr valign=middle> <td class="TableCenterCustomerForm">{$lng.lbl_first_name}</td> <td><font class=StarStyle>*</font></td> <td nowrap> <input type=text name=firstname size=32 maxlength=32 value="{$userinfo.firstname}"> {if $fillerror ne "" and $userinfo.firstname eq ""}<font class=StarStyle>&lt;&lt;</font>{/if} </td> </tr> <tr valign=middle> <td class="TableCenterCustomerForm">{$lng.lbl_last_name}</td> <td><font class=StarStyle>*</font></td> <td nowrap> <input type=text name=lastname size=32 maxlength=32 value="{$userinfo.lastname}"> {if $fillerror ne "" and $userinfo.lastname eq ""}<font class=StarStyle>&lt;&lt;</font>{/if} </td> </tr> <tr valign=middle> <td class="TableCenterCustomerForm">{$lng.lbl_email}</td> <td><font class=StarStyle>*</font></td> <td nowrap> <input type=text name=email size=32 maxlength=128 value="{$userinfo.email}"> {if $fillerror ne "" and $userinfo.email eq ""}<font class=StarStyle>&lt;&lt;</font>{/if} </td> </tr> <tr valign=middle> <td class="TableCenterCustomerForm">{$lng.lbl_subject}</td> <td><font class=StarStyle>*</font></td> <td nowrap> <input type=text name=subject size=32 maxlength=128 value="{$userinfo.subject}"> {if $fillerror ne "" and $userinfo.subject eq ""}<font class=StarStyle>&lt;&lt;</font>{/if} </td> </tr> <tr valign=middle> <td class="TableCenterCustomerForm">{$lng.lbl_message}</td> <td><font class=StarStyle>*</font></td> <td nowrap> <textarea cols=48 rows=12 name=body>{$userinfo.body}</textarea> {if $fillerror ne "" and $userinfo.body eq ""}<font class=StarStyle>&lt;&lt;</font>{/if} </td> </tr> <tr valign=middle> <td></td> <td></td> <td nowrap> {include file="buttons/submit.tpl"} </td> </tr> <input type=hidden name=usertype value="{$usertype}"> </form> </table> {else} {$lng.txt_contact_us_sent} {/if} {/capture} {include file="dialog.tpl" title=$lng.lbl_contact_us content=$smarty.capture.dialog extra="width=100%"}

i made sure I only deleted the revelavnt stuff, and none of the email codes..perhaps I did something wrong?

Thanks
Reply With Quote
  #8  
Old 10-28-2002, 10:36 AM
 
syddos syddos is offline
 

eXpert
  
Join Date: Sep 2002
Location: London, England, UK
Posts: 259
 

Default

Hi Japanchick,

Found your problem in the javascript error checking code, I cut-n-pasted your code into my contactus.tpl, and the invalid email error message came up, I then copied the javascript code from my working "contactus.tpl" over your javascript code, and it worked ok.

cut-n-paste the following code into contactus.tpl, to overwrite the existing javascript error checking code.

Quote:
{* $Id: contactus.tpl,v 1.15 2002/09/12 10:25:45 verbic Exp $ *}
{literal}
<script>
function checkEmailAddress(field) {
var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.go v)|(\.org)|(\..{2,2}))$)\b/gi);

if (goodEmail) {
return true;
} else {
alert("E-mail address is invalid! Please correct");
field.focus();
field.select();
return false;
}
}
</script>
{/literal}

Regards,
__________________
Syddos

Nothing is impossible, We just don't know how to do it ........Yet!

Xcart 4.1.X PRO (Testing Platform: winXP Pro)
Perl 5.8.7 (win32)
WINAMP 1.6.3 (win32 server package. Includes the following)
- phpMyAdmin v2.8.03
- MySql 5.0.21
- Apache 2.0.55 (win32)
- php 5.1.4
- SQLitemanager 1.2.0
Reply With Quote
  #9  
Old 10-28-2002, 04:09 PM
 
japanchick japanchick is offline
 

Advanced Member
  
Join Date: Oct 2002
Posts: 64
 

Default

Hi Syddos,

Thank you for your help...but I still cant get it to work I checked the new javascript you posted but it seems the same as my old one?

In any case, I did what you said and I am still getting that anooying pop-up box saying email is invalid. Here is the code Im using:
Quote:
{* $Id: contactus.tpl,v 1.15 2002/09/12 10:25:45 verbic Exp $ *}
{literal}
<script>
function checkEmailAddress(field) {
var goodEmail = field.value.match(/b(^(S+@).+((.com)|(.net)|(.edu)|(.mil)|(.gov)|(.or g)|(..{2,2}))$)b/gi);

if (goodEmail) {
return true;
} else {
alert("E-mail address is invalid! Please correct");
field.focus();
field.select();
return false;
}
}
</script>
{/literal}
{if $smarty.get.mode eq "update"}
{$lng.txt_contact_us_header}
{/if}



{capture name=dialog}
{if $smarty.get.mode eq "update"}
<table width=100% border=0 cellspacing=0 cellpadding=2>
<form action="help.php?section=contactus&mode=update&act ion=contactus" method=post name=registerform>


<tr valign=middle>
<td class="TableCenterCustomerForm">{$lng.lbl_title}</td>
<td><font class=StarStyle>*</font></td>
<td nowrap>
<select name=title>
{section name=title loop=$name_titles}
<option {if $userinfo.title eq $name_titles[title]}selected{/if}>{$name_titles[title]}</option>
{/section}
</select>
</td>
</tr>

<tr valign=middle>
<td class="TableCenterCustomerForm">{$lng.lbl_first_na me}</td>
<td><font class=StarStyle>*</font></td>
<td nowrap>
<input type=text name=firstname size=32 maxlength=32 value="{$userinfo.firstname}">
{if $fillerror ne "" and $userinfo.firstname eq ""}<font class=StarStyle>&lt;&lt;</font>{/if}
</td>
</tr>

<tr valign=middle>
<td class="TableCenterCustomerForm">{$lng.lbl_last_nam e}</td>
<td><font class=StarStyle>*</font></td>
<td nowrap>
<input type=text name=lastname size=32 maxlength=32 value="{$userinfo.lastname}">
{if $fillerror ne "" and $userinfo.lastname eq ""}<font class=StarStyle>&lt;&lt;</font>{/if}
</td>
</tr>


<tr valign=middle>
<td class="TableCenterCustomerForm">{$lng.lbl_email}</td>
<td><font class=StarStyle>*</font></td>
<td nowrap>
<input type=text name=email size=32 maxlength=128 value="{$userinfo.email}">
{if $fillerror ne "" and $userinfo.email eq ""}<font class=StarStyle>&lt;&lt;</font>{/if}
</td>
</tr>



<tr valign=middle>
<td class="TableCenterCustomerForm">{$lng.lbl_subject} </td>
<td><font class=StarStyle>*</font></td>
<td nowrap>
<input type=text name=subject size=32 maxlength=128 value="{$userinfo.subject}">
{if $fillerror ne "" and $userinfo.subject eq ""}<font class=StarStyle>&lt;&lt;</font>{/if}
</td>
</tr>

<tr valign=middle>
<td class="TableCenterCustomerForm">{$lng.lbl_message} </td>
<td><font class=StarStyle>*</font></td>
<td nowrap>
<textarea cols=48 rows=12 name=body>{$userinfo.body}</textarea>
{if $fillerror ne "" and $userinfo.body eq ""}<font class=StarStyle>&lt;&lt;</font>{/if}
</td>
</tr>

<tr valign=middle>
<td></td>
<td></td>
<td nowrap>


{include file="buttons/submit.tpl"}
</td>
</tr>
<input type=hidden name=usertype value="{$usertype}">
</form>
</table>
{else}
{$lng.txt_contact_us_sent}
{/if}
{/capture}
{include file="dialog.tpl" title=$lng.lbl_contact_us content=$smarty.capture.dialog extra="width=100%"}

Thanks
Reply With Quote
  #10  
Old 10-29-2002, 01:38 AM
 
syddos syddos is offline
 

eXpert
  
Join Date: Sep 2002
Location: London, England, UK
Posts: 259
 

Default

Quote:
Thank you for your help...but I still cant get it to work I checked the new javascript you posted but it seems the same as my old one?

In any case, I did what you said and I am still getting that anooying pop-up box saying email is invalid. Here is the code Im using:

I have just pasted your code into my "contactus.tpl" and I'm getting the error message. I then restored the original help/contactus.tpl file, and deleted the items one by one to match your code. Each time I deleted an entry, I sent the email, without any error messages.

If you are using an edititor other than Admin/Edit templates, your editor may be adding non print characters to the template. Here is the code I used to match your template.
Quote:
{* $Id: contactus.tpl,v 1.15 2002/09/12 10:25:45 verbic Exp $ *}
{literal}
<script>
function checkEmailAddress(field) {
var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.go v)|(\.org)|(\..{2,2}))$)\b/gi);

if (goodEmail) {
return true;
} else {
alert("E-mail address is invalid! Please correct");
field.focus();
field.select();
return false;
}
}
</script>
{/literal}
{if $smarty.get.mode eq "update"}
{$lng.txt_contact_us_header}
{/if}



{capture name=dialog}
{if $smarty.get.mode eq "update"}
<table width=100% border=0 cellspacing=0 cellpadding=2>
<form action="help.php?section=contactus&mode=update&act ion=contactus" method=post name=registerform>


<tr valign=middle>
<td class="TableCenterCustomerForm">{$lng.lbl_title}</td>
<td><font class=StarStyle>*</font></td>
<td nowrap>
<select name=title>
{section name=title loop=$name_titles}
<option {if $userinfo.title eq $name_titles[title]}selected{/if}>{$name_titles[title]}</option>
{/section}
</select>
</td>
</tr>

<tr valign=middle>
<td class="TableCenterCustomerForm">{$lng.lbl_first_na me}</td>
<td><font class=StarStyle>*</font></td>
<td nowrap>
<input type=text name=firstname size=32 maxlength=32 value="{$userinfo.firstname}">
{if $fillerror ne "" and $userinfo.firstname eq ""}<font class=StarStyle>&lt;&lt;</font>{/if}
</td>
</tr>

<tr valign=middle>
<td class="TableCenterCustomerForm">{$lng.lbl_last_nam e}</td>
<td><font class=StarStyle>*</font></td>
<td nowrap>
<input type=text name=lastname size=32 maxlength=32 value="{$userinfo.lastname}">
{if $fillerror ne "" and $userinfo.lastname eq ""}<font class=StarStyle>&lt;&lt;</font>{/if}
</td>
</tr>


<tr valign=middle>
<td class="TableCenterCustomerForm">{$lng.lbl_email}</td>
<td><font class=StarStyle>*</font></td>
<td nowrap>
<input type=text name=email size=32 maxlength=128 value="{$userinfo.email}">
{if $fillerror ne "" and $userinfo.email eq ""}<font class=StarStyle>&lt;&lt;</font>{/if}
</td>
</tr>


<tr valign=middle>
<td class="TableCenterCustomerForm">{$lng.lbl_subject} </td>
<td><font class=StarStyle>*</font></td>
<td nowrap>
<input type=text name=subject size=32 maxlength=128 value="{$userinfo.subject}">
{if $fillerror ne "" and $userinfo.subject eq ""}<font class=StarStyle>&lt;&lt;</font>{/if}
</td>
</tr>

<tr valign=middle>
<td class="TableCenterCustomerForm">{$lng.lbl_message} </td>
<td><font class=StarStyle>*</font></td>
<td nowrap>
<textarea cols=48 rows=12 name=body>{$userinfo.body}</textarea>
{if $fillerror ne "" and $userinfo.body eq ""}<font class=StarStyle>&lt;&lt;</font>{/if}
</td>
</tr>

<tr valign=middle>
<td></td>
<td></td>
<td nowrap>


{include file="buttons/submit.tpl"}
</td>
</tr>
<input type=hidden name=usertype value="{$usertype}">
</form>
</table>
{else}
{$lng.txt_contact_us_sent}
{/if}
{/capture}
{include file="dialog.tpl" title=$lng.lbl_contact_us content=$smarty.capture.dialog extra="width=100%"}

This is the /help/help.php Code:
Quote:
$filerror = (empty($contact["firstname"]) || empty($contact["lastname"]) || empty($contact["email"]) || empty($contact["subject"]) || empty($contact["body"]));


Quote:
This is the disabled existing error checking code
# $fillerror = (empty($contact["firstname"]) || empty($contact["lastname"]) || empty($contact["b_address"]) || empty($contact["b_city"]) || empty($contact["b_country"]) || empty($contact["b_zipcode"]) || empty($contact["phone"]) || empty($contact["email"]) || empty($contact["subject"]) || empty($contact["body"]));

I then copied your code back into "contactus.tpl" and the error message was back. I suggest you restore the original file and delete un-wanted items using Admin/template editor (if you are not already doing so), and double check the "/help/help.php" file.

Regards,
__________________
Syddos

Nothing is impossible, We just don't know how to do it ........Yet!

Xcart 4.1.X PRO (Testing Platform: winXP Pro)
Perl 5.8.7 (win32)
WINAMP 1.6.3 (win32 server package. Includes the following)
- phpMyAdmin v2.8.03
- MySql 5.0.21
- Apache 2.0.55 (win32)
- php 5.1.4
- SQLitemanager 1.2.0
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 07:45 AM.

   

 
X-Cart forums © 2001-2020