Sidebar

startup_tutorial_and_checklist:design_configuration:smarty_template_code_extensions:contact_seller_form_in_details_page

Create the Contact Seller Form In Your Listing Details Page

By default the contact seller form is a separate page linked to within the listing details page. You by default see the "contact seller" link within the listing details page. This links to the contact seller page where the client can fill in the form to ask the seller a question. You can duplicate that functionality within the listing details page so the client does not need to link to the contact seller page. One of the reasons for having the link is that the contact seller form can take a lot of room in the details page you may not want to give up. But if you don't mind follow this tutorial to add that form to your listing details page.

<tip c n>Note that if you add the contact seller form to your listing details page you cannot use the security image addon within this form</tip>

What you will basically do is recreate the contact seller page form within your listing details page. To do that all your changes will happen within the listing details page templates you have for your site. By default that is the following two templates and whether you change one or both is based on the version of software you have with us:

listing_classified.tpl
listing_auction.tpl

Both of the above are found in the /main_page/ directory of your custom template set.

The changes you make will be to basically reproduce the html found in the contact seller form within listing details template. If you look at the html source of the contact seller you'll find an html that basically looks like the following but without the css:

<form action="index.php?a=13&amp;b=XXX" method="post">
	Your Name:<input type="text" name="c[senders_name]" id="c_senders_name" value="" class="field" />	

	Your Email Address:<input type="text" name="c[senders_email]" id="c_senders_email" value="" class="field" />	

	Phone:<input type="text" name="c[senders_phone]" id="c_senders_phone" value="" class="field" />

	Your Comments:<textarea name="c[senders_comments]" id="c_senders_comments" cols="78" rows="7" class="field"></textarea>	

	<input type="submit" name="submit" value="Send Message" class="button" />
	<input type="reset" name="reset" value="Reset" class="button" />
</form>

If you look at your own contact seller html source you will see a LOT more html in that. The html above are basically all the extraneous html and css stripped away leaving the basic html form that you would base your html contact seller form on. Of course you can change the displayed text to what you like and change/remove the id's to your needs but the above is the starting point for your contact seller form to be placed into the listing details page.

There is one thing more before you are done. You'll note in the above for the "XXX" in the form action statement. That "XXX" is a variable that will change with each listing. It happens to be the id for that auction or classified ad. So that value needs to be different for each classified or auction within the system. It's easy to do. The following tag available within the listing details template will insert that into the form for us:

{listing field='classified_id'}

So placing that in the form above gets us this:

<form action="index.php?a=13&amp;b={listing field='classified_id'}" method="post">
	Your Name:<input type="text" name="c[senders_name]" id="c_senders_name" value="" class="field" />	

	Your Email Address:<input type="text" name="c[senders_email]" id="c_senders_email" value="" class="field" />	

	Phone:<input type="text" name="c[senders_phone]" id="c_senders_phone" value="" class="field" />

	Your Comments:<textarea name="c[senders_comments]" id="c_senders_comments" cols="78" rows="7" class="field"></textarea>	

	<input type="submit" name="submit" value="Send Message" class="button" />
	<input type="reset" name="reset" value="Reset" class="button" />
</form>

That should do it. All that's left for you is to use the text, html and css you like to make that form look the way you want.

startup_tutorial_and_checklist/design_configuration/smarty_template_code_extensions/contact_seller_form_in_details_page.txt · Last modified: 2014/09/25 16:55 (external edit)