Post by philbydevil » Fri Feb 24, 2012 6:20 am

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

form-contact-page.jpg (28.07 KiB) Viewed 23498 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.

Attachments


I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by philbydevil » Thu Mar 01, 2012 7:32 am

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

Picture-3-web.jpg (23.34 KiB) Viewed 23433 times

Attachments


I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by visnetmedia » Mon Apr 02, 2012 12:06 pm

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?

Active Member

Posts

Joined
Fri Feb 12, 2010 7:17 am

Post by giovanni.davi » Mon Apr 02, 2012 6:58 pm

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

Newbie

Posts

Joined
Mon Jun 06, 2011 2:56 pm

Post by philbydevil » Tue Apr 10, 2012 12:35 pm

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.
Last edited by philbydevil on Tue Apr 10, 2012 12:39 pm, edited 1 time in total.

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by philbydevil » Tue Apr 10, 2012 12:37 pm

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.

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by visnetmedia » Tue Apr 24, 2012 3:04 pm

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...

Active Member

Posts

Joined
Fri Feb 12, 2010 7:17 am

Post by visnetmedia » Wed Apr 25, 2012 3:22 pm

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>
 

Active Member

Posts

Joined
Fri Feb 12, 2010 7:17 am

Post by visnetmedia » Mon Apr 30, 2012 2:27 pm

Hi I got this to work but on submit even with errors closes the lightbox. Getting closer..

Active Member

Posts

Joined
Fri Feb 12, 2010 7:17 am

Post by visnetmedia » Wed Feb 06, 2013 3:35 pm

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.

Active Member

Posts

Joined
Fri Feb 12, 2010 7:17 am

Post by philbydevil » Thu Feb 07, 2013 4:11 am

I don't think you've removed the country/zone completely.

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by i2Paq » Thu Feb 07, 2013 4:36 pm

Does this work on 1.5.4.1?

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by philbydevil » Fri Feb 08, 2013 6:11 am

Yep, should do.

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by xiaohaizhi » Thu Aug 08, 2013 6:15 pm

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.

Newbie

Posts

Joined
Thu Aug 08, 2013 5:57 pm

Post by andaluza » Fri Aug 09, 2013 11:21 am

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>

Newbie

Posts

Joined
Fri Aug 09, 2013 11:18 am

Post by tonerrefillman » Wed Aug 14, 2013 4:10 am

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>

New member

Posts

Joined
Wed Jul 24, 2013 9:24 pm

Post by Atavius » Thu Nov 07, 2013 3:04 am

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?

Newbie

Posts

Joined
Mon May 09, 2011 7:55 pm

Post by smashtransit » Sat Apr 11, 2015 8:33 pm

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.

New member

Posts

Joined
Wed Apr 04, 2012 9:14 pm

Post by Faalsa » Thu Jul 23, 2015 4:03 am

WILL THIS WORK WITH OPENCART V2.0.3.1

Newbie

Posts

Joined
Wed May 20, 2015 12:10 am
Who is online

Users browsing this forum: No registered users and 41 guests