Jump to content

[SOLVED] passing a value to contact-form.php


Recommended Posts

I'm looking through my themes (moon theme) tpl files and noticed in the contact-form.tpl the following:

{if isset($smarty.post.id_contact) && $smarty.post.id_contact == $contact.id_contact}selected="selected"{/if}


My understanding from this is theres a way to pass a pre-selected value to the contact-form.php and have it slected for the user.

I have added a button on my product.tpl to allow a customer to submit an offer:
http://pastie.org/871158

under BO > Employees > Contacts I have a contact_id 3 value="Submit Offer"

So my question is how do I pass contact-form.php the proper pre-selected value?

UPDATE:
I've added

$smarty->debugging = true;

to contact-form.php and the smarty debugging console pops up http://pastie.org/872270 but there is no "post" variable anywhere to be found. Any ideas?

Solution:
In the products.tpl you must use the post meathod. Doing so you don't have to change anything in the contact-form.tpl
heres my "make offer button"

        <!-- Make offer form -->
       <form id="make_offer" action="{$base_dir}contact-form.php" method="post">    

quantity == 0} style="display:none;"{/if} id="make_offer" class="buttons_bottom_block"><input type="submit" name="make_offer" value="{l s='Make Offer'}" class="exclusive" /></p>
           <input type="hidden" name="id_contact" value="3" />
       </form>



After more digging, I found that you still need to edit the contact-form.tpl and change the line that hides the description. Heres what it is in my code:



{$contact.description|escape:'htmlall':'UTF-8'}


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...