Jump to content

Using PHP and .tpl to show non presta content


Recommended Posts

Hello everybody, I hope someone can help me with this.

I've been developing this book catalogue using Presta and, until now, all sections have been created using Presta features or third party modules. Now we need to develop a "Contact Us" section that shows a multi-contact-form depending on the "department" or subject you're trying to reach.

You can see the old site form here http://editorialrm.com/i/contactanos
and see new one using Presta here http://editorialrm.com/2010/contactanos.php?id_lang=1

We had it developed in pure php an a little touch of Jscript to do that options menu "jump" and everything worked perfect... until I tried to use a .tpl to show this content (is very important to use a .tpl because I DO need a translation, main language is Spanish and second one is English).

I've tried to use {php}phpCode{/php} but it wont work.
The problem is that the menu does not show the different forms, and I'm not quite sure if it's an issue of .tpl showing php code or Jscript code...
I'm running out of ideas...

I make an attach of the two files I'm using now (contactanos.php and contactanos.tpl)
and the original file we had first programmed on php that worked perfectly (contactanos_bak.php)

Any Ideas? Do you think I will have to use Smarty at any point to make that options work?

Thanks in advance!!

contactanos.php

contactanos_bak.php

contactanos.tpl.zip

Link to comment
Share on other sites

Yo no te aconsejo el uso de bloques {php} dentro del tpl, debes asignar el valor de $secc a una variable de Smarty.

$smarty->assign('secc', $secc);
$smarty->display(_PS_THEME_DIR_.'contactanos.tpl');


Los 'echo' que tienes en el php debes asignarlo a una variable y pasarlos también al smarty.

En el tpl debes poner

{if $secc==1}selected="selected"{/if}


para sustituir

{php}if($secc==1){ echo 'selected="selected"';}{/php}



El resto de bloques if los cambias igual

Espero haberte ayudado
Un salduo

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