Products + FormBuilder - passing product name to form

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
waldemar_r
Forum Members
Forum Members
Posts: 20
Joined: Fri Mar 05, 2010 2:34 pm

Products + FormBuilder - passing product name to form

Post by waldemar_r »

Hi,

How can I pass product name to the Form?

In the Product module I would like to place a link (Ask for this product) which redirects to Contact page. There will be a contact form. If one enter Contact page by the link the name of the product is show in one to the fields. If one enter directly (from Menu) this field isn't shown.

How can I obtain the name of the product in the contact?
uniqu3

Re: Products + FormBuilder - passing product name to form

Post by uniqu3 »

With FormBuilder you are able to include in the {FormBuilder} tag a parameter (not sure about correct parameter please look at help) value_fld_23='something' where 23 would be id of the field you would use for Product name and set to hidden.

Then if you use {cms_selflink} inside Products Template to link to the page with Form you could use urlparam parameter (see tags help) where you could use for example {cms_sleflink page='content_page' urlparam="?prod=`$entry->product_name`" text='Content'}

On page with Form you would then use a FormBuilder call like {FormBuilder form='product-form' value_fld_23=$smarty.get.prod} (see Smarty help http://www.smarty.net/docsv2/de/languag ... smarty.tpl)
If you are using CGSimpleSmarty then you could also use session with $smarty.session (see module help for session tag)

Easier method:

You could use FormBuilder for example on Product Detailpage (Detail Tempalte) then you could skip smarty.get or smarty.session part and simple use value_fld23=$entry->product_name, with some JavaScript youcould hide Form and show it on click or however you want it to behave.
Post Reply

Return to “Modules/Add-Ons”