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)
-   -   Mandatory fields on the Contact Us form (https://forum.x-cart.com/showthread.php?t=7017)

Risky 04-05-2004 09:37 AM

Mandatory fields on the Contact Us form
 
Can anyone advise me on how I can stop a field on the Contact Us form, from being mandatory.

For example, I don't really need to know the person's full address, and I feel that making this compulsory will only frustrate a potential customer, with the risk of losing them.

I really only need to know his name, email address, email subject and his/her message.

Grateful for your advice. Thanks, Robert (V 3.5.3)

B00MER 04-07-2004 01:00 AM

edit include/help.php:

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"]));

Update the code accordingly ;)

Risky 04-10-2004 02:02 AM

Hi Boomer,

Thanks for your response .. which I am anxious to try out .. please just guide me to where I find Include/help.php .... is this accessed from the Admin area? I've looked around the Templates area, which I am getting more familiar with, but can't find these files with the .php extension.

Sorry .. this must be sooo basic.

Many thanks
Robert

leed 04-10-2004 02:38 AM

help.php
 
It's in the include directory in your main x-cart directory.
e.g. If your x-cart is installed in shop
then help.php will be in shop/include

LeeD

Risky 04-13-2004 10:56 AM

Thanks people for your help .. your suggestions greatly helped, but it wasn't the full story. Here's what else is required if it helps anyone else.

If you just edit help.php, and the customer accidentally still omits any of the fields you have left as mandatory, there is code in the help/contactus.tpl that also checks and marks fields on the Contact Us form that are mandatory and it will still find the omissions.

So, you need to edit the tpl file to remove or comment out these checks on the fields that aren't mandatory, PLUS you need to remove the red asterisks that mark those same fields as being mandatory (for the customer to see). I simply replaced the "*" characters with "&nbsp" (which will make it easier if I ever want to reinstate some/all of my changes later on).

Now, the form looks and works exactly like I wanted, with only a few mandatory fields.

rgbdna 08-31-2004 12:34 AM

One step further?
 
Hi Risky,

Thanks for the followup. I was wondering, does anyone know how to do this on the checkout page...registration. Where it asks for your name, title, billing and shipping address...etc?

I can see that this page is built from a series of includes.

So for example if I did not want to make EMAIL required during checkout?

Thanks,

rgbdna

shan 08-31-2004 07:20 AM

Re: One step further?
 
Quote:

Originally Posted by rgbdna
Hi Risky,

Thanks for the followup. I was wondering, does anyone know how to do this on the checkout page...registration. Where it asks for your name, title, billing and shipping address...etc?

I can see that this page is built from a series of includes.

So for example if I did not want to make EMAIL required during checkout?

Thanks,

rgbdna


include/register.php


All times are GMT -8. The time now is 02:19 AM.

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