Page 1 of 1
[vQmod] Add contact form to information page
Posted: Fri Feb 24, 2012 6:20 am
by philbydevil
Inspired by this thread:
http://forum.opencart.com/viewtopic.php?f=20&t=53452
Special thanks to Eyechild for his patience getting the code right.
What it does:
Adds a contact form to one of your information pages
eg:
form-contact-page.jpg (28.07 KiB) Viewed 24459 times
Instructions are included with the zip. Make sure that you read them carefully or it won't work.
Tested on 1.5.1.3 only.
Re: [vQmod] Add contact form to information page
Posted: Thu Mar 01, 2012 7:32 am
by philbydevil
UPDATE: version below now has drop down selection for country and state/zone as well as a field for confirming that the correct email address was entered.
Picture-3-web.jpg (23.34 KiB) Viewed 24394 times
Re: [vQmod] Add contact form to information page
Posted: Mon Apr 02, 2012 12:06 pm
by visnetmedia
Awesome work - Hi is there anyway after this form is sent that the email goes to the admin email and also to person sending the form with a link to a pdf to download?
Re: [vQmod] Add contact form to information page
Posted: Mon Apr 02, 2012 6:58 pm
by giovanni.davi
Thank you for your contribute,
I got an error with the 1.4.9
Call to a member function link() on a non-object in .../vq2-catalog_controller_information_information.php on line 12
Do you have any idea on how can I fix this bug?
Thanks a lot
Re: [vQmod] Add contact form to information page
Posted: Tue Apr 10, 2012 12:35 pm
by philbydevil
visnetmedia wrote:Awesome work - Hi is there anyway after this form is sent that the email goes to the admin email and also to person sending the form with a link to a pdf to download?
I'm sure that it could be done. Maybe ask on the thread listed in the first post as this is where all of the info came from to make this vQmod.
EDIT: I see that you've already asked there. Hopefully SkipperTheEyeChild can help.
Re: [vQmod] Add contact form to information page
Posted: Tue Apr 10, 2012 12:37 pm
by philbydevil
giovanni.davi wrote:Thank you for your contribute,
I got an error with the 1.4.9
Call to a member function link() on a non-object in .../vq2-catalog_controller_information_information.php on line 12
Do you have any idea on how can I fix this bug?
Thanks a lot
As mentioned in the first post, this is tested on 1.5.1.3 only. You'll have to look through the vQmod and the files that it references as I'm sure that there are many differences that won't work "out of the box" in the 1.4.9.
Re: [vQmod] Add contact form to information page
Posted: Tue Apr 24, 2012 3:04 pm
by visnetmedia
Hi the dropdowns are awesome - is there a way to have this show in fancybox - I see some code in there:
Code: Select all
<add><![CDATA[
<script type="text/javascript"><!--
$('select[name=\'zone_id\']').load('index.php?route=account/register/zone&country_id=<?php echo $country_id; ?>&zone_id=<?php echo $zone_id; ?>');
//--></script>
<script type="text/javascript"><!--
$('.fancybox').fancybox({
width: 560,
height: 560,
autoDimensions: false
});
//--></script>
]]></add>
Would be really cool if on the information page you have a link and it pops up to use saving space on a large page. Is this possible or is this code for something else?
Thanks again...
Re: [vQmod] Add contact form to information page
Posted: Wed Apr 25, 2012 3:22 pm
by visnetmedia
Hi I gave it a try and the fancybox shows but is blank - this is what I put in can you please tell me what I can change to get it to work:
Code: Select all
<file name="catalog/view/theme/default/template/information/information.tpl">
<operation>
<search position="after"><![CDATA[
<?php echo $description; ?>
]]></search>
<add><![CDATA[
<?php if ($this->request->get['information_id'] == 9) { ?>
<a href="#contactfrm" title="Conference Form" class="fancybox"> Click Here To Enquire About Allan's Conference Events</a>
<div id="contactfrm" style="display:none;">
<form action="" method="post" enctype="multipart/form-data" id="contact">
<div class="content">
<div class="left"><span class="required">*</span> <b><?php echo $text_name; ?></b><br />
<input type="text" name="name" value="<?php echo $name; ?>" />
<br />
<?php if ($error_name) { ?>
<span class="error"><?php echo $error_name; ?></span>
<?php } ?>
<br />
<span class="required">*</span> <b><?php echo $text_company; ?></b><br />
<input type="text" name="company" value="<?php echo $company; ?>" />
<br />
<?php if ($error_company) { ?>
<span class="error"><?php echo $error_company; ?></span>
<?php } ?>
<br />
<span class="required">*</span> <b><?php echo $text_street_address; ?></b><br />
<input type="text" name="street_address" value="<?php echo $street_address; ?>" />
<br />
<?php if ($error_street_address) { ?>
<span class="error"><?php echo $error_street_address; ?></span>
<?php } ?>
<br />
<b><?php echo $text_street_address_2; ?></b><br />
<input type="text" name="street_address_2" value="<?php echo $street_address_2; ?>" />
<br />
<?php if ($error_street_address_2) { ?>
<span class="error"><?php echo $error_street_address_2; ?></span>
<?php } ?>
<br />
<span class="required">*</span> <b><?php echo $text_suburb; ?></b><br />
<input type="text" name="suburb" value="<?php echo $suburb; ?>" />
<br />
<?php if ($error_suburb) { ?>
<span class="error"><?php echo $error_suburb; ?></span>
<?php } ?>
<br />
<span class="required">*</span> <b><?php echo $text_postcode; ?></b><br />
<input type="text" name="postcode" value="<?php echo $postcode; ?>" />
<br />
<?php if ($error_postcode) { ?>
<span class="error"><?php echo $error_postcode; ?></span>
<?php } ?>
<br />
<span class="required">*</span> <b><?php echo $text_country; ?></b></b><br />
<select name="country_id" onchange="$('select[name=\'zone_id\']').load('index.php?route=account/register/zone&country_id=' + this.value + '&zone_id=<?php echo $zone_id; ?>');">
<option value=""><?php echo $text_select; ?></option>
<?php foreach ($countries as $country) { ?>
<?php if ($country['country_id'] == $country_id) { ?>
<option value="<?php echo $country['country_id']; ?>" selected="selected"><?php echo $country['name']; ?></option>
<?php } else { ?>
<option value="<?php echo $country['country_id']; ?>"><?php echo $country['name']; ?></option>
<?php } ?>
<?php } ?>
</select>
<br/>
<?php if ($error_country) { ?>
<span class="error"><?php echo $error_country; ?></span>
<?php } ?>
<br />
<span class="required">*</span> <b><?php echo $text_zone; ?></b><br />
<select name="zone_id">
</select>
<br/>
<?php if ($error_zone) { ?>
<span class="error"><?php echo $error_zone; ?></span>
<?php } ?>
<br />
<b><?php echo $text_enquiry; ?></b><br />
<textarea name="enquiry" cols="40" rows="10" style="width: 80%;"><?php echo $enquiry; ?></textarea>
<br />
<?php if ($error_enquiry) { ?>
<span class="error"><?php echo $error_enquiry; ?></span>
<?php } ?>
<br /></div>
<div class="right"><span class="required">*</span> <b><?php echo $text_phone; ?></b><br />
<input type="text" name="phone" value="<?php echo $phone; ?>" />
<br />
<?php if ($error_phone) { ?>
<span class="error"><?php echo $error_phone; ?></span>
<?php } ?>
<br />
<b><?php echo $text_mobile; ?></b><br />
<input type="text" name="mobile" value="<?php echo $mobile; ?>" />
<br />
<?php if ($error_mobile) { ?>
<span class="error"><?php echo $error_mobile; ?></span>
<?php } ?>
<br />
<span class="required">*</span> <b><?php echo $text_email; ?></b><br />
<input type="text" name="email" value="<?php echo $email; ?>" />
<br />
<?php if ($error_email) { ?>
<span class="error"><?php echo $error_email; ?></span>
<?php } ?>
<br />
<span class="required">*</span> <b><?php echo $text_confirm; ?></b></b><br />
<input type="text" name="confirm" value="<?php echo $confirm; ?>" />
<br/>
<?php if ($error_confirm) { ?>
<span class="error"><?php echo $error_confirm; ?></span>
<?php } ?>
<br />
<span class="required">*</span> <b><?php echo $text_captcha; ?></b><br />
<input type="text" name="captcha" value="<?php echo $captcha; ?>" />
<br />
<img src="index.php?route=information/contact/captcha" alt="" />
<?php if ($error_captcha) { ?>
<span class="error"><?php echo $error_captcha; ?></span>
<?php } ?>
<br /><br /><br />
<div class="buttons">
<a onclick="$('#contact').submit();" class="button"><span>Submit Event Enquiry!</span></a></div>
</div>
</div>
</form>
</div>
<?php } ?>
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[
<div class="right"><a href="<?php echo $continue; ?>" class="button"><span><?php echo $button_continue; ?></span></a></div>
]]></search>
<add><![CDATA[
<div class="breadcrumb"><br /></div><div class="right"><a href="<?php echo $continue; ?>" class="button"><span><?php echo $button_return_home; ?></span></a></div>
]]></add>
</operation>
<operation>
<search position="after"><![CDATA[
<?php echo $content_bottom; ?></div>
]]></search>
<add><![CDATA[
<script type="text/javascript"><!--
$('select[name=\'zone_id\']').load('index.php?route=account/register/zone&country_id=<?php echo $country_id; ?>&zone_id=<?php echo $zone_id; ?>');
//--></script>
<script type="text/javascript"><!--
$('.fancybox').fancybox({
width: 560,
height: 560,
autoDimensions: false
});
//--></script>
]]></add>
</operation>
</file>
Re: [vQmod] Add contact form to information page
Posted: Mon Apr 30, 2012 2:27 pm
by visnetmedia
Hi I got this to work but on submit even with errors closes the lightbox. Getting closer..
Re: [vQmod] Add contact form to information page
Posted: Wed Feb 06, 2013 3:35 pm
by visnetmedia
Hi I have changed this xml to not have the country dropdown but keep getting this error:
Code: Select all
PHP Notice: Undefined variable: country_id in /home/peaseint/public_html/vqmod/vqcache/vq2-catalog_view_theme_default_template_information_information.tpl on line 101
PHP Notice: Undefined variable: zone_id in /home/peaseint/public_html/vqmod/vqcache/vq2-catalog_view_theme_default_template_information_information.tpl on line 101
Is there anyway I can stop this error?
Thanks - it works well.
Re: [vQmod] Add contact form to information page
Posted: Thu Feb 07, 2013 4:11 am
by philbydevil
I don't think you've removed the country/zone completely.
Re: [vQmod] Add contact form to information page
Posted: Thu Feb 07, 2013 4:36 pm
by i2Paq
Does this work on 1.5.4.1?
Re: [vQmod] Add contact form to information page
Posted: Fri Feb 08, 2013 6:11 am
by philbydevil
Yep, should do.
Re: [vQmod] Add contact form to information page
Posted: Thu Aug 08, 2013 6:15 pm
by xiaohaizhi
Hi Im using versoin 1.5.3.1.
However was unable to have it working.
Please assist in where and which lines of code to make changes for it to work on 1.5.3.1.
Thank you.
Re: [vQmod] Add contact form to information page
Posted: Fri Aug 09, 2013 11:21 am
by andaluza
For 1.5.5.1it wasn't working so I just modified the following:
Code: Select all
[b]Replace line 37:[/b]
<search position="bottom" offset="2"><![CDATA[
]]></search>
[b]TO:[/b]
<search position="bottom" offset="2"><![CDATA[
}
?>
]]></search>
Re: [vQmod] Add contact form to information page
Posted: Wed Aug 14, 2013 4:10 am
by tonerrefillman
Hi phil
don't seem to be getting this to work think its done ok
supposed to go to this page
http://tonerrefilluk.co.uk/toner-cartri ... ng-service
Hope you can help
Garry
Code: Select all
</operation>
</file>
<file name="catalog/language/english/english.php">
<operation>
<search position="after"><![CDATA[
$_['button_continue'] = 'Continue';
]]></search>
<add><![CDATA[
$_['button_return_home'] = 'Homepage';
]]></add>
</operation>
</file>
<file name="catalog/view/theme/otp716/template/information/information.tpl">
<operation>
<search position="after"><![CDATA[
<?php echo $description; ?>
]]></search>
<add><![CDATA[
<?php if ($this->request->get['information_id'] == 13) { ?>
<form action="" method="post" enctype="multipart/form-data" id="contact">
<div class="content">
<div class="left"><span class="required">*</span> <b><?php echo $text_name; ?></b><br />
<input type="text" name="name" value="<?php echo $name; ?>" />
<br />
<?php if ($error_name) { ?>
<span class="error"><?php echo $error_name; ?></span>
<?php } ?>
<br />
<span class="required">*</span> <b><?php echo $text_company; ?></b><br />
<input type="text" name="company" value="<?php echo $company; ?>" />
<br />
<?php if ($error_company) { ?>
<span class="error"><?php echo $error_company; ?></span>
<?php } ?>
<br />
<span class="required">*</span> <b><?php echo $text_street_address; ?></b><br />
<input type="text" name="street_address" value="<?php echo $street_address; ?>" />
<br />
<?php if ($error_street_address) { ?>
<span class="error"><?php echo $error_street_address; ?></span>
<?php } ?>
<br />
<b><?php echo $text_street_address_2; ?></b><br />
<input type="text" name="street_address_2" value="<?php echo $street_address_2; ?>" />
<br />
<?php if ($error_street_address_2) { ?>
<span class="error"><?php echo $error_street_address_2; ?></span>
<?php } ?>
<br />
<span class="required">*</span> <b><?php echo $text_suburb; ?></b><br />
<input type="text" name="suburb" value="<?php echo $suburb; ?>" />
<br />
<?php if ($error_suburb) { ?>
<span class="error"><?php echo $error_suburb; ?></span>
<?php } ?>
<br />
<span class="required">*</span> <b><?php echo $text_postcode; ?></b><br />
<input type="text" name="postcode" value="<?php echo $postcode; ?>" />
<br />
<?php if ($error_postcode) { ?>
<span class="error"><?php echo $error_postcode; ?></span>
<?php } ?>
<br />
<span class="required">*</span> <b><?php echo $text_country; ?></b></b><br />
<select name="country_id" onchange="$('select[name=\'zone_id\']').load('index.php?route=account/register/zone&country_id=' + this.value + '&zone_id=<?php echo $zone_id; ?>');">
<option value=""><?php echo $text_select; ?></option>
<?php foreach ($countries as $country) { ?>
<?php if ($country['country_id'] == $country_id) { ?>
<option value="<?php echo $country['country_id']; ?>" selected="selected"><?php echo $country['name']; ?></option>
<?php } else { ?>
<option value="<?php echo $country['country_id']; ?>"><?php echo $country['name']; ?></option>
<?php } ?>
<?php } ?>
</select>
<br/>
<?php if ($error_country) { ?>
<span class="error"><?php echo $error_country; ?></span>
<?php } ?>
<br />
<span class="required">*</span> <b><?php echo $text_zone; ?></b><br />
<select name="zone_id">
</select>
<br/>
<?php if ($error_zone) { ?>
<span class="error"><?php echo $error_zone; ?></span>
<?php } ?>
<br />
<b><?php echo $text_enquiry; ?></b><br />
<textarea name="enquiry" cols="40" rows="10" style="width: 80%;"><?php echo $enquiry; ?></textarea>
<br />
<?php if ($error_enquiry) { ?>
<span class="error"><?php echo $error_enquiry; ?></span>
<?php } ?>
<br /></div>
<div class="right"><span class="required">*</span> <b><?php echo $text_phone; ?></b><br />
<input type="text" name="phone" value="<?php echo $phone; ?>" />
<br />
<?php if ($error_phone) { ?>
<span class="error"><?php echo $error_phone; ?></span>
<?php } ?>
<br />
<b><?php echo $text_mobile; ?></b><br />
<input type="text" name="mobile" value="<?php echo $mobile; ?>" />
<br />
<?php if ($error_mobile) { ?>
<span class="error"><?php echo $error_mobile; ?></span>
<?php } ?>
<br />
<span class="required">*</span> <b><?php echo $text_email; ?></b><br />
<input type="text" name="email" value="<?php echo $email; ?>" />
<br />
<?php if ($error_email) { ?>
<span class="error"><?php echo $error_email; ?></span>
<?php } ?>
<br />
<span class="required">*</span> <b><?php echo $text_confirm; ?></b></b><br />
<input type="text" name="confirm" value="<?php echo $confirm; ?>" />
<br/>
<?php if ($error_confirm) { ?>
<span class="error"><?php echo $error_confirm; ?></span>
<?php } ?>
<br />
<b><?php echo $text_website; ?></b><br />
<input type="text" name="website" value="<?php echo $website; ?>" />
<br />
<?php if ($error_website) { ?>
<span class="error"><?php echo $error_website; ?></span>
<?php } ?>
<br />
<span class="required">*</span> <b><?php echo $text_captcha; ?></b><br />
<input type="text" name="captcha" value="<?php echo $captcha; ?>" />
<br />
<img src="index.php?route=information/contact/captcha" alt="" />
<?php if ($error_captcha) { ?>
<span class="error"><?php echo $error_captcha; ?></span>
<?php } ?>
<br /><br /><br />
<div class="buttons">
<a onclick="$('#contact').submit();" class="button"><span>Submit Listing!</span></a></div>
</div>
</div>
</form>
<?php } ?>
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[
<div class="right"><a href="<?php echo $continue; ?>" class="button"><span><?php echo $button_continue; ?></span></a></div>
]]></search>
<add><![CDATA[
<div class="right"><a href="<?php echo $continue; ?>" class="button"><span><?php echo $button_return_home; ?></span></a></div>
]]></add>
</operation>
<operation>
<search position="after"><![CDATA[
<?php echo $content_bottom; ?></div>
]]></search>
<add><![CDATA[
<script type="text/javascript"><!--
$('select[name=\'zone_id\']').load('index.php?route=account/register/zone&country_id=<?php echo $country_id; ?>&zone_id=<?php echo $zone_id; ?>');
//--></script>
<script type="text/javascript"><!--
$('.fancybox').fancybox({
width: 560,
height: 560,
autoDimensions: false
});
//--></script>
]]></add>
</operation>
</file>
</modification>
Re: [vQmod] Add contact form to information page
Posted: Thu Nov 07, 2013 3:04 am
by Atavius
I am trying to get working this contact mod, but I cant figure out what I am doing wrong. I followed instruction and edited xml file, but contact for is still not showing on information page at all. Is there any code that I need to insert also to the page itself or something else I am missing?
Re: [vQmod] Add contact form to information page
Posted: Sat Apr 11, 2015 8:33 pm
by smashtransit
Any idea if this will work for 1.5.6.4, or if there's any recommended extension available for something like this? I found one, but the support seems to be lacking at best.
Re: [vQmod] Add contact form to information page
Posted: Thu Jul 23, 2015 4:03 am
by Faalsa
WILL THIS WORK WITH OPENCART V2.0.3.1