Reputation: 9549
I want to include a PHP script that outputs some HTML in productdetail-full.tpl file (Smarty / Prestashop 1.6.x)
I tried:
{php}
include('show-stock-pos.php');
{/php}
AND
{include_php 'show-stock-pos.php'}
But they are both deprecated. Any suggestions?
Thanks!
Upvotes: 0
Views: 2394
Reputation: 1457
Prestashop is a modular system that uses hooks to display information.
According to Prestashop standards and solutions, you should use hooks and module:
Upvotes: 0
Reputation: 18022
You should use SmartyBC - Backwards Compatibility Wrapper
for this since it's not recommended using php code in the templates.
Instead of:
require_once('path/to/smarty/libs/Smarty.class.php');
$smarty = new Smarty();
Use:
require_once('path/to/smarty/libs/SmartyBC.class.php');
$smarty = new SmartyBC();
And you will be able to use PHP in your Smarty template files.
More info about this here:
https://www.smarty.net/docs/en/bc.tpl
Upvotes: 2