Jump to content

A different way to add contact form & other links


Guest kickass

Recommended Posts

Guest kickass

Just passing on another way to add a contact form link, or other types of links, to your CubeCart installation.

Though I'm sure that the mod for contact form in the download area works nicely, I have this aversion to hacking core code to get things to work, since it always bites me in the posterior at upgrade time, especially when it's the client who decides to do the upgrade . . . so I try to make things as foolproof as possible in planning for these future events. ;)

You can create a static html page with contact form using any of the usual formmail scripts out there (I know there's a bunch at hotscripts). In my most recent particular case, since we have a WordPress Blog also set up on the site, and there's a contact form already in place there, the link to that contact form was all that was needed. If you use a different script, you simply need the link to your contact form page once it's set up. It's easiest to use absolute urls here.

Now in your template find styleTemplates/boxes/ and open the siteDocs.tpl in your code or text editor.

Immediately before

<!-- BEGIN: a -->
 add this:




<a href="http://linktoyourcontactform.com/contactformurl.htm" class="txtSiteDocs">Contact Us</a>



<span class="txtSiteDocs">|</span>

Save and upload the file.

Now, go into your Cubecart Admin area, and click Documents/Site Documents. Delete the "Contact Us" document there, since you won't need it.

All done!

Other links can also be added here in the same way, either before the "BEGIN: a" comment or after the "END: a" comment, just remember to include the class="txtSiteDocs" in the anchor tag, and your divider thingy in the appropriate place, so if, like us, you have more than one area in your site, it's easy to add links to them here from your CubeCart installation.

Enjoy!

Link to comment
Share on other sites

For all you out there you will notice this then leaves CC...

As an alternative to linking in the site documents i would like to tell you all a 3rd way usng I-Frames...

The best thing its invlves NO editing of exsistings code, in the way described about create a contact form, you just want a HTML page that has a form on it here Nothing else, (tip try and match the background colour to that of the Document Box BG Colour...

Open Up your Exsisting Contact Us Site Doc (Create A New One If doesn't exsist) Click on the Button that says "SORCE" Then delete any Exsisting Code, and insert the following.

<iframe src="/link/to/reletive/file.html" width="100%" Height="400"></iframe>

Simply change the src to the location of the form and change the width and height to fit correctly...

This also means that the Confirmation of delivery page of what ever else you use is also in the Iframe so there is no page refresh. You can also remove the borders but of the top of my mind i cant remember how...

Link to comment
Share on other sites

Guest kickass

um, though this is certainly another way to add a contact form (one that just plain wouldn't work in my current design), you missed the point. This is a way of adding links to other parts of a site . . .

Link to comment
Share on other sites

Thanks kickass and aikdo :wub:

There are numerous ways to remove the proverbial cat from its pelt B)

And there are many, many ways to add links into CC templates, too.

Contact forms: Estelle has a paid mod for putting a fully flexible javascript contact form into your cart, and I like it alot. I does require editing two source files, but what the hell - it's worth it. I like to edit all the files for an upgrade before uploading to my stores, no big deal anyway.

See it in action at my site on this Contact Page :lol:

Link to comment
Share on other sites

Guest estelle

I have this aversion to hacking core code to get things to work

There's a difference between hacking and modding. Most paid mods are properly designed and coded, and come with good installation instructions and full support. Free mods on the other hand, will sometimes be hacks. And trying to add functionality without changing any of the existing files is much more likely to result in a hacked solution... :)

Link to comment
Share on other sites

  • 3 weeks later...
Guest Muslimin

Need contact form? I made this for my clients' stores.

Copy from my site

http://muslimin.org/tijarah/index.php?act=viewDoc&docId=2

Use the FCK Editor which will copy EXACTLY the form.

Click on `Source'

Change the mailer***.php to yours.

Anybody needs the Mailer****.php get it here. PLease note that the PHP does not bring user back to anywhere, it sends the email and display the message. Somebody please add the functionality

<?PHP

$to = "[email protected]";

$subject = "Some annoying customer bugging the store owner";

$headers = "From: Mystore.com";

$forward = 0;

$location = "";

$date = date ("l, F jS, Y");

$time = date ("h:i A");

$msg = "Below is the result of your feedback form. It was submitted on $date at $time.\n\n";

if ($_SERVER['REQUEST_METHOD'] == "POST") {

foreach ($_POST as $key => $value) {

  $msg .= ucfirst ($key) ." : ". $value . "\n";

}

}

else {

foreach ($_GET as $key => $value) {

  $msg .= ucfirst ($key) ." : ". $value . "\n";

}

}

mail($to, $subject, $msg, $headers);

if ($forward == 1) {

    header ("Location:$location");

}

else {

    echo "Terima kasih.  Kami akan memberikan maklumbalas dan membantu anda dengan segera.

Thank you for submitting our form. We will get back to you as soon as possible.";

}

?>

Link to comment
Share on other sites

Neat solution, Muslimin! :huh:

Here's the code for this form:

<form enctype="multipart/form-data" action="http://muslimin.org/mailerMusliminyahooemail.php" method="post" name="form1"><input type="hidden" name="PHPSESSID" value="37074694e635a98d4902883ac3452feb" />

    <b><b>        </b></b>

    <div style="text-align: center;"><b><b> <font class="med"> <input type="hidden" value="[email protected]" name="recipient"/> <input type="hidden" value="Muslimin.org - TIJARAH" name="subject"/> <input type="hidden" value="http://muslimin.org/tijarah" name="redirect"/> </font>        </b></b></div>

    <table width="87%" cellspacing="2" cellpadding="1" align="center" style="border: 1px solid rgb(24, 49, 90); padding: 7px; width: 175px; background-color: rgb(242, 244, 250);">

        <tbody>

            <tr>

                <td height="31" colspan="2" class="med" style="text-align: center;"><span style="font-family: arial; font-weight: bold;"><span style="color: rgb(51, 51, 255);">MAKLUMAT &amp; CADANGAN</span><br style="color: rgb(51, 51, 255);"/>              <br style="color: rgb(51, 51, 255);"/><span style="color: rgb(51, 51, 255);"> [Maklumat anda adalah rahsia]</span><br/>

                </span> </td>

                <td width="57%" height="31"><textarea cols="30" rows="5" name="message"></textarea></td>

            </tr>

            <tr>

                <td height="7" colspan="2" class="med" style="font-family: arial;">

                <div style="text-align: center; font-weight: bold; color: rgb(51, 51, 255);"><font size="2" class="med"><big>Nama</big></font></div>

                <font size="2" class="med"> </font></td>

                <td width="57%" height="7"><font class="med"> <input type="text" size="35" name="name"/> </font></td>

            </tr>

            <tr>

                <td colspan="2" class="med" style="text-align: center; font-family: arial; color: rgb(51, 51, 255);"><big><font size="2" class="med"><big>E-mail</big></font></big></td>

                <td width="57%"> <font class="med"> <input type="text" size="35" name="email"/> </font></td>

            </tr>

            <tr>

                <td colspan="2" class="med" style="text-align: center; color: rgb(51, 51, 255);"><span style="font-family: arial;">No. telefon, HP atau pejabat</span> </td>

                <td width="57%"> <font class="med"> <input type="text" size="35" name="city"/> </font></td>

            </tr>

        </tbody>

    </table>

    <div style="text-align: center;"><b><b> <font class="med"> <input type="submit" value="Submit" name="Submit"/> </font><span class="med"></span><br/>

    <span class="med"> </span></b></b></div>

</form>

Link to comment
Share on other sites

Guest Muslimin

Here's the English form

<form enctype="multipart/form-data" action="http://muslimin.org/mailerMusliminyahooemail.php" method="post" name="form1">

    <b><b>        </b></b>

    <div style="text-align: center;"><b><b> <font class="med"> <input type="hidden" value="[email protected]" name="recipient"/> <input type="hidden" value="Muslimin.org - TIJARAH" name="subject"/> <input type="hidden" value="http://muslimin.org" name="redirect"/> </font>        </b></b></div>

    <table width="87%" cellspacing="2" cellpadding="1" align="center" style="border: 1px solid rgb(24, 49, 90); padding: 7px; width: 175px; background-color: rgb(242, 244, 250);">

        <tbody>

            <tr>

                <td height="31" colspan="2" class="med" style="text-align: center;"><span style="font-family: arial; font-weight: bold;"><span style="color: rgb(51, 51, 255);">INFO &amp; SUGGESTIONS</span><br style="color: rgb(51, 51, 255);"/>              <br style="color: rgb(51, 51, 255);"/><span style="color: rgb(51, 51, 255);"> [Your info is kept confidential]</span><br/>

                </span> </td>

                <td width="57%" height="31"><textarea cols="30" rows="5" name="message"></textarea></td>

            </tr>

            <tr>

                <td height="7" colspan="2" class="med" style="font-family: arial;">

                <div style="text-align: center; font-weight: bold; color: rgb(51, 51, 255);"><font size="2" class="med"><big>Name</big></font></div>

                <font size="2" class="med"> </font></td>

                <td width="57%" height="7"><font class="med"> <input type="text" size="35" name="name"/> </font></td>

            </tr>

            <tr>

                <td colspan="2" class="med" style="text-align: center; font-family: arial; color: rgb(51, 51, 255);"><big><font size="2" class="med"><big>E-mail</big></font></big></td>

                <td width="57%"> <font class="med"> <input type="text" size="35" name="email"/> </font></td>

            </tr>

            <tr>

                <td colspan="2" class="med" style="text-align: center; color: rgb(51, 51, 255);"><span style="font-family: arial;">Phone &amp; Location, Country</span> </td>

                <td width="57%"> <font class="med"> <input type="text" size="35" name="city"/> </font></td>

            </tr>

        </tbody>

    </table>

    <div style="text-align: center;"><b><b> <font class="med"> <input type="submit" value="Submit" name="Submit"/> </font><span class="med"></span><br/>

    <span class="med"> </span></b></b></div>

</form>

*BTW MArk, how does your mailer works? Mine does not bring user back to the store page, it just stays there, user has to click the back button on the web browser.

Link to comment
Share on other sites

Guest Muslimin

Thank you guys, this reminds me of my previous store <_<

Now I remembered this one form which has the pulldown menu, and textarea, and inputs. The mailer.php also brings user back to or forward to any page specified.

See the actual form (in Malay language but you can change it to anything).

http://awaskemalangan.com/SAFETY-PRODUCT/checkout.php

<form name="form1" method="post"

action="http://awaskemalangan.com/SAFETY-PRODUCT/mailer.php"

enctype="multipart/form-data"> <font class="med"> <input

name="recipient" value="[email protected]" type="hidden"> <input

name="subject" value="AWAS Online" type="hidden"> <input

name="redirect" value="http://awaskemalangan.com" type="hidden"> </font>

<table align="center" cellpadding="1" cellspacing="2"

width="87%">

<tbody>

<tr>

<td class="med" colspan="2" height="31">SALINKAN SENARAI

PRODUK, BILANGAN, DAN JUMLAH HARGA<br>

(dari muka laman sebelum ini)<br>

Contoh:<br>

First Aid Kit&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 55.00 (per

unit)&nbsp;&nbsp;&nbsp;&nbsp; 165.00 (bagi 3 unit)<br>

</td>

<td height="31" width="57%"><textarea name="message"

rows="5" cols="30"></textarea></td>

</tr>

<tr>

<td class="med" colspan="2" height="7"><font class="med"

size="2"><big>Nama Pembeli</big> </font></td>

<td height="7" width="57%"><font class="med"> <input

name="name" size="35" type="text"> </font></td>

</tr>

<tr>

<td class="med" colspan="2"><big><font class="med"

size="2"><big>E-mail</big></font></big></td>

<td width="57%"> <font class="med"> <input name="email"

size="35" type="text"> </font></td>

</tr>

<tr>

<td class="med" colspan="2"><big><font class="med"

size="2"><big>Alamat, </big></font></big>bandar, poskod, negeri</td>

<td width="57%"> <font class="med"> <input

name="address" size="35" type="text"> </font></td>

</tr>

<tr>

<td class="med" colspan="2">No.

telefon rumah, HP atau pejabat </td>

<td width="57%"> <font class="med"> <input name="city"

size="35" type="text"> </font></td>

</tr>

<tr>

<td class="med" colspan="2"> <font class="med" size="2"><big>No.

telefon bimbit (untuk SMS)</big></font></td>

<td width="57%"> <font class="med"> <input name="state"

size="35" type="text"> </font></td>

</tr>

<tr>

<td style="font-weight: bold;" class="med" colspan="2">P<font

class="med" size="2"><big>roduk&nbsp;

(tuliskan nama produk)</big></font> </td>

<td width="57%"> <font class="med"> <input

name="country" size="35" type="text"> </font></td>

</tr>

<tr>

<td class="med" colspan="2"><font class="med" size="2"><big

style="font-weight: bold;">Bilangan dan jumlah harga <br>

(Ringgit Malaysia)</big><br>

</font></td>

<td width="57%"> <font class="med"> <input

name="zipcode" type="text"> </font></td>

</tr>

<tr>

<td class="med" colspan="2">Pembayaran / Payment Option</td>

<td width="57%">

<select name="pay_method">

<option value="Maybank2u" selected="selected">Maybank2u.com</option>

<option value="Pindahan tunai Maybank">Pindahan tunai

Maybank</option>

<option value="Kiriman wang pos">Kiriman wang pos</option>

<option value="Cek">Cek</option>

</select>

</td>

</tr>

<tr>

<td class="med" colspan="2"><font class="med" size="2"><big>Pesanan

anda</big><br>

</font></td>

<td width="57%"> <font class="med"> <input

name="comments" size="35" type="text"> </font></td>

</tr>

<tr>

<td style="vertical-align: top;"><span

style="font-weight: bold;">PENERIMA BARANG</span><br>

Masukkan nama Penerima (jika berlainan), <br>

Alamat, No. Telefon, e-mail <br>

</td>

<td style="vertical-align: top;"><br>

</td>

<td style="vertical-align: top;"><textarea name="Penerima"

rows="5" cols="30"></textarea></td>

</tr>

</tbody>

</table>

<div style="text-align: center;"> <font class="med"> <input

name="Submit" value="Submit" type="submit"> </font><span class="med"></span><br>

<span class="med"> </span></div>

<p> </p>

</form>

Link to comment
Share on other sites

BTW MArk, how does your mailer works? Mine does not bring user back to the store page, it just stays there, user has to click the back button on the web browser

As I mentioned near the beginning of this thread, mine is based on a paid mod from estelle, so I am not at liberty to share the files :lol:

It is a nice javascript driven mailform, fully customizable.

Link to comment
Share on other sites

  • 1 month later...
Guest Muslimin

WARNING!!!! Contact form is spam infested!

I must warn you guys that my contact form has become spam targets - spam emails keep coming via a contact form I used on a website similar to the one above (not CubeCart yet) but I believe someday the spammers will find the contact form in my CC store too.

SO if there is a way to block spammers - for example the use of CAPTCHA so that only real humans who really need to contact us by form (but lazy to just use his email, or does not have email, or email server is down at the moment he needs to use it)

Link to comment
Share on other sites

Guest estelle

With the above contact form your email address is sent in the HTML to the web browser, so your email address will eventually be collected by spam harvesters.

Its better if the email address is never revealed to the web browser (as is the case with my mod B))

Link to comment
Share on other sites

Be aware CubeCart Tell a friend is a potential SPAM target too however worse thing - it can be a Mail Bomber source B)

What files need to be edited to remove the "Tell a friend" link? I know this is a bad source of spam and would like to get rid of it! I see some hosts are disabling some contact forms as they are overloading the mail servers. I've had some come through that they have tried to add "BCC" , of course I can't tell if they were successful. With "Tell a friend", we wouldn't even see what they tried to send would we?

Link to comment
Share on other sites

Remove Tell-a-Friend

In the skin files, open styleTemplates/content/viewProd.tpl and remove the following:

	<ul>

		<li class="bulletLrg"><a href="index.php?act=taf&amp;productId={PRODUCT_ID}" target="_self" class="txtDefault">{LANG_TELLFRIEND}</a></li>

	</ul>

You can also expunge includes/tellafriend.inc.ph, styleTemplates/content/tellafriend.tpl and expunge the reference to tellafriend.inc.php from the root index.php

No time now for instructions on that.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...