Forums / Templates, Stylesheets, Page Layout / Remove Contact Us Form

Remove Contact Us Form

Locked
Results 1 to 15 of 15
This thread is locked. New replies are disabled.
18 Jul 2009, 18:44
#1
arkangil avatar

arkangil

New Zenner

Join Date:
Jul 2009
Posts:
7
Plugin Contributions:
0

Remove Contact Us Form

Hi all,

I am pretty new to working with this stuff. I had my website created for me using a zen template, however I am now taking over the maintenance myself. You may see more of me now!

I have a Contact Us page that has some custom content that I added through the define pages editor page. There is also the default contact us form hat comes from the tpl_contact_us_default page.

Because I cannot get the email sending to work, I would like to just remove the form altogether, and leave only my custom content.

I have found a few pages that claim to walk me through this, however so far it has not worked. I guess I don't remove the correct part, and wind up with a "page ended unexpectedly on line xx" syntax error.

Any help would be appreciated. If I need to provide more information, or code, I would be happy to.

Thanks everyone.
20 Jul 2009, 21:31
#2
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Remove Contact Us Form

Well, the quick fix is to add this to the bottom of your stylesheet

#contactUsForm{display:none;}


Yes you can edit the php files, but this works and if you ever want to put it back in then it is easy.
20 Jul 2009, 22:05
#3
arkangil avatar

arkangil

New Zenner

Join Date:
Jul 2009
Posts:
7
Plugin Contributions:
0

Re: Remove Contact Us Form

In my templates/template/CSS folder I have a number of files.

style.css
style_companyname.css
stylesheet.css
stylesheet_css_buttons.css
print_stylesheet.css

I added that piece of code to the top three, and still the form appears. I just added it at the bottom before any ending argument line.

Where did I mess up? Is there another place on my site where this might be called from. If I View Source on the page, these seem to be the only ones called.

Thanks
20 Jul 2009, 22:12
#4
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Remove Contact Us Form

well, it should work in the bottom of the main stylesheet, stylesheet.css. (works fine on my test site - but style.css and style_companyname are unique to your site by the looks of it) Can you post a link to your site and we'll see why it isn't playing the game?

cheers
21 Jul 2009, 00:11
#6
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Posts:
19,793
Plugin Contributions:
2

Re: Remove Contact Us Form

Just a suggestion, but I would leave the stock Contact Us form, remove the part you added (which contains email addresses in the clear - an open invitation to spammers) and fix the email issues.
21 Jul 2009, 08:55
#7
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Remove Contact Us Form

I agree with Stevesh.

However, if you still want to go this route the first thing you should do is make sure that your links are not such tasty spam-bait. Have a look at : http://www.ianr.unl.edu/email/encode/ which will help.

Then:

Your site has been edited a bit so my first suggestion will not play the game, I am afraid. The fieldset that exits in the default version does not exist in yours :smile: so setting display:none has no effect! Sorry, but that is why URL is so useful.

So, if you really want to go this route, then you are going to have to edit a php file. The file that you are after is:

includes/templates/yourtemplate/templates/tpl_contact_us_default.php

If you are struggling getting that to work then you can post the whole of this file on the forum as yours is evidently different to to default version. You will have to zip it before attaching it to a post.
21 Jul 2009, 12:21
#8
arkangil avatar

arkangil

New Zenner

Join Date:
Jul 2009
Posts:
7
Plugin Contributions:
0

Re: Remove Contact Us Form

I am at a loss. I think a part of this page is calling the define page, which is what I modify in Zen Cart itself. But I cannot tell which part of the code relates to the form. I am all new to PHP.

Thanks for your help with this. I may hijack my own thread with some more questions shortly!
21 Jul 2009, 12:45
#9
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Posts:
19,793
Plugin Contributions:
2

Re: Remove Contact Us Form

If you really want to do this, it looks like removing (or commenting out) lines 48 through 78 in that template file will remove the form, but leave the stuff you entered in define_contact_us. Back up your file somewhere first, in case it doesn't work for your installation.
21 Jul 2009, 13:08
#10
arkangil avatar

arkangil

New Zenner

Join Date:
Jul 2009
Posts:
7
Plugin Contributions:
0

Re: Remove Contact Us Form

Something odd happened. I put the open comment code ( /* ) at the start of line 48, and the close comment code ( */) at the end of line 78

All I got was my contact form still there, with those codes visible in my web browser.

How did I mess that up?
21 Jul 2009, 13:12
#11
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Posts:
19,793
Plugin Contributions:
2

Re: Remove Contact Us Form

PHP is commented with //, rather than /*, which is what HTML uses.
21 Jul 2009, 13:36
#12
arkangil avatar

arkangil

New Zenner

Join Date:
Jul 2009
Posts:
7
Plugin Contributions:
0

Re: Remove Contact Us Form

So this will probably make the professional coders out there cringe, but I found that if I simply remove (I backed up) the tpl_contact_us page altogether, I wound up with a page that contained only my zen cart text, and the "back" and "send" buttons, which I can remove the code for.

I did try the commenting, and it worked, but line 78 wasn't far enough. As I was working my way down, I eventually got lost in my process, and that is how I accidentally wound up with no tpl file at all, and saw the results.

Thanks for all your help!

Now I will continue my struggle with adding a new page to the right-hand "Information" bar.
21 Jul 2009, 14:01
#13
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Remove Contact Us Form

yes, 48 to 86 needs to go to get rid of the send button but not the back button.

But I really would consider stevesh's first comment about the better way of doing it !
21 Jul 2009, 14:03
#14
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Remove Contact Us Form

Have a look at the About Us mod. It adds the page you want and has clear instructions.
15 Dec 2009, 03:59
#15
shirster avatar

shirster

Zen Follower

Join Date:
Sep 2005
Posts:
301
Plugin Contributions:
0

Re: Remove Contact Us Form

For my 1.3.8a Zen Cart, version $Id: tpl_contact_us_default.php 4272 2006-08-26 03:10:49Z, just comment out line 48-78 to get rid of the contact us form using !-- and --

:)