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)
-   -   Grr... (https://forum.x-cart.com/showthread.php?t=434)

japanchick 10-27-2002 07:54 PM

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!

japanchick 10-27-2002 08:53 PM

oh yes
 
Regarding the question about the email,

I am using Sendmail on linux if that is important at all =)

syddos 10-27-2002 10:44 PM

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,

seaCOAST 10-28-2002 01:55 AM

hmm...if HTML mail is selected in general settings, won't the cart send emails without line-breaks? (if that's the correct terminology)

japanchick 10-28-2002 04:12 AM

hi!
 
Hi,

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

Thanks!

syddos 10-28-2002 06:40 AM

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,

japanchick 10-28-2002 09:57 AM

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

syddos 10-28-2002 10:36 AM

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,

japanchick 10-28-2002 04:09 PM

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

syddos 10-29-2002 01:38 AM

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,

japanchick 10-29-2002 10:47 AM

Thanks!
 
Hi Syddos,

I copied the code and re-entered it using the admin/templete and it still didnt work...SO, I downloaded the original contactus.tpl from the skin1original folder, opened it up in Notepad, delete the stuff i didnt want, and then saved the file and uploaded to my skin1 directory and now it works! Perhaps there is something wrong with my browser or something in that it adds in extra characters or something? Kinda funny....

One more thing, although i entered the code, as long as I put an email address, I am able to send a message - even though the First Name, Last Name, Subject, and Message fields are empty...is this what is supposed to happen? I would have thought that an error sign would pop up saying "sorry, the please enter your first name" or something like that..

Thanks,

japanchick

seaCOAST 10-29-2002 11:05 AM

Re: Thanks!
 
Quote:

Originally Posted by japanchick
Hi Syddos,

I copied the code and re-entered it using the admin/templete and it still didnt work...SO, I downloaded the original contactus.tpl from the skin1original folder, opened it up in Notepad, delete the stuff i didnt want, and then saved the file and uploaded to my skin1 directory and now it works! Perhaps there is something wrong with my browser or something in that it adds in extra characters or something? Kinda funny....

One more thing, although i entered the code, as long as I put an email address, I am able to send a message - even though the First Name, Last Name, Subject, and Message fields are empty...is this what is supposed to happen? I would have thought that an error sign would pop up saying "sorry, the please enter your first name" or something like that..

Thanks,

japanchick



Actually, I've had similiar problems, but only once in a while.
Using the built-in editor somehow corrupted the template and gave me smarty errors.
I edited the original the same way using editpad lite, re-uploaded it and it was fine.

Does anyone know if it's browser settings?

Not meaning to post off-topic here, but while where on the subject... 8)
when I cut and paste from a website to an html editor (ie FrontPage), I get alot of garbage characters, but if I paste into a text editor it works fine.
Any ideas?

Jeannie 10-29-2002 11:47 AM

seaCOAST....
It's a Frontpage thang.

You'd have to go into the frontpage html and strip/change all the garbage after you make your wsiwyg changes and not go back to page view after that. Or copy your FP html to a texteditor and do the character fixing there. I hear Dreamweaver does a clean job of pasting

seaCOAST 10-29-2002 12:37 PM

Quote:

Originally Posted by Jeannie
seaCOAST....
It's a Frontpage thang.

You'd have to go into the frontpage html and strip/change all the garbage after you make your wsiwyg changes and not go back to page view after that. Or copy your FP html to a texteditor and do the character fixing there. I hear Dreamweaver does a clean job of pasting


Thanks Jeannie.
I figured as much. That's exactly what I do...I paste to a text editor than cut from there and paste it into FP.

rpmoore 10-31-2002 11:21 AM

remove fields from Contact Us form
 
Thank you syddos for answering this question and to japanchick for asking the question. I was able to remove the unwanted fields in the Contact Us form very easily and quickly withour error after reading your posts.

how I love a forum!

rpmoore :D


All times are GMT -8. The time now is 09:14 PM.

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