alfredopacino Posted April 6, 2014 Share Posted April 6, 2014 hi i want to offer to my customers a "lower price guarantee" for some products. as you see in attachment i want just to add a link to contact form. i found a paid module http://addons.prestashop.com/it/funzionalita-front-office-moduli-prestashop/11396-richiesta-info-prodotto.html but i just want a link to the contact form page (with the product field already set in the form), so i think i dont need this.. Link to comment Share on other sites More sharing options...
drugmirko Posted April 6, 2014 Share Posted April 6, 2014 (edited) hey, go to your theme folder, open product.tpl go to line 226, there will be <!-- usefull links--> <ul id="usefull_link_block" class="clearfix no-print"> {if $HOOK_EXTRA_LEFT}{$HOOK_EXTRA_LEFT}{/if} <li class="print"> <a href="javascript:print();"> {l s='Print'} </a> </li> {if $have_image && !$jqZoomEnabled}{/if} </ul> and just add your link after the </li> Edited April 6, 2014 by drugmirko (see edit history) 1 Link to comment Share on other sites More sharing options...
alfredopacino Posted April 6, 2014 Author Share Posted April 6, 2014 uhm, i noticed the contact form hasn't a "Product field" but just an "order" select.. i guess i should edit the contact form, is that possible? Link to comment Share on other sites More sharing options...
alfredopacino Posted May 12, 2014 Author Share Posted May 12, 2014 (edited) up? i explain better what i need: the contact form hasn't a Product text field, so it could be helpful something like that: - In product page a link like that <a href="contactpage/?product=productname">do you find a lower price?</a> and i know how to do that -in form an extra text field named Product with this php code as value if(isset($_GET['product'])) echo $_GET['product']; Edited May 12, 2014 by alfredopacino (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted May 12, 2014 Share Posted May 12, 2014 you can add this productname to the textbox "message" for example, in contact.tpl code add: <input type="hidden" id="productname" value="{Tools::getValue('productname')}"/> {if $smarty.get.productname} {literal} <script> $(document).ready(function(){ $("#message").html("i found this product with better price: "+$("#productname").val()); }); </script> {/literal} {/if} Link to comment Share on other sites More sharing options...
alfredopacino Posted May 12, 2014 Author Share Posted May 12, 2014 i get a syntax error Link to comment Share on other sites More sharing options...
vekia Posted May 12, 2014 Share Posted May 12, 2014 missed } in: <input type="hidden" id="productname" value="{Tools::getValue('productname')"/> use: <input type="hidden" id="productname" value="{Tools::getValue('productname')}"/> Link to comment Share on other sites More sharing options...
alfredopacino Posted May 12, 2014 Author Share Posted May 12, 2014 (edited) ok totally works that part, now could you help me with the correct link: <a href="/contattaci?productname={$product->name|escape:'html':'UTF-8}">blabla</a> obiouvsly dont work Edited May 12, 2014 by alfredopacino (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted May 12, 2014 Share Posted May 12, 2014 obiouvsly dont work don't work because? you see 404? some errors? Link to comment Share on other sites More sharing options...
alfredopacino Posted May 12, 2014 Author Share Posted May 12, 2014 don't work because? you see 404? some errors? syntax error, i dont know the syntax, it was just a shot in the dark Link to comment Share on other sites More sharing options...
vekia Posted May 12, 2014 Share Posted May 12, 2014 hmm the link works? when you click on it you're properly redirected to contact page with ?productname param ? Link to comment Share on other sites More sharing options...
alfredopacino Posted May 12, 2014 Author Share Posted May 12, 2014 (edited) hmm the link works? when you click on it you're properly redirected to contact page with ?productname param ? i said syntax error .. PS doesnt even load the product page Edited May 12, 2014 by alfredopacino (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted May 13, 2014 Share Posted May 13, 2014 i tested code on my own, it works make sure that you use exactly the same code; <input type="hidden" id="productname" value="{Tools::getValue('productname')}"/> {if $smarty.get.productname} {literal} <script> $(document).ready(function(){ $("#message").html("i found this product with better price: "+$("#productname").val()); }); </script> {/literal} {/if} in contat-form.tpl file remember about recompilation of theme Link to comment Share on other sites More sharing options...
alfredopacino Posted May 13, 2014 Author Share Posted May 13, 2014 sorry ill try to explain better: your code works as i said in #8 post. MY code dont works: <a href="/contattaci?productname={$product->name|escape:'html':'UTF-8}">blabla</a> Link to comment Share on other sites More sharing options...
Recommended Posts