Error TPL PHP Prestashop
NickName:Yuto McTwinky Ask DateTime:2017-07-10T21:59:09

Error TPL PHP Prestashop

I am working on Prestashop and I would like to retrieve the data from a table I created in my database. I've been on it for 2 days and nothing works, I'll go crazy.

Here is the code I put in my ProductController.php file:

    private function GetAvailableAttributes($id_produit, $id_compte, $note)
    {      
    global $smarty;  
$sql = 'SELECT id_produit, id_compte, note
        FROM `'.'ps_product_avis';
    $ess=mysql_result($sql,0);
$smarty->assign('contact', $ess);
    }

Here is the code put in the product.tpl file:

<li>test :{$contact}</li>

Here's the mistake it gives:

Error message

Could one of you save me and explain where the problem comes from please?

I thank you in advance.

Copyright Notice:Content Author:「Yuto McTwinky」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/45014018/error-tpl-php-prestashop

More about “Error TPL PHP Prestashop” related questions

Prestashop PHP Include in a .tpl does not work

I am creating a storefront for a client using Prestashop. Prestashop uses Smarty .TPL files. I read through smarty documentation and scoured the web but all of the suggestions are not working. I f...

Show Detail

Error TPL PHP Prestashop

I am working on Prestashop and I would like to retrieve the data from a table I created in my database. I've been on it for 2 days and nothing works, I'll go crazy. Here is the code I put in my

Show Detail

How to detect device in smarty in prestashop 1.7 in a TPL file?

I want the following: &amp; I understand I have to take the codes from context.php of PrestaShop but I seem to be making an error. A link to getcontext is as follows: (The code to detect mobile de...

Show Detail

javascript code with php into .tpl prestashop

I'm trying to do a conditional selector with javascript and php. I have already done before, but in wordpress (pure php), now I have to adapt to prestashop (.tpl file). It is not so easy to write ...

Show Detail

How to inspect html code in Prestashop to link to the PHP TPL files

It is my understanding (prob completely wrong) that the php/tpl/etc files of a Prestashop site create the html page(s) of my website (see image). Im using Developer tools on Firefox Quantum Dev ed...

Show Detail

how to add php code in .tpl file in prestashop

Does anyone know how to add php code in .tpl file in prestashop..i tried a lot but couldn't find any solutions..I want to add a mail function in my .tpl file This is the function &lt;?php $na...

Show Detail

PHP Prestashop extend form.tpl

I would like to extend the form.tpl of Prestashop (1.6.1.1). Therefor I created the following path in my module folder: modules/mymodule/views/templates/admin/export/helpers/form/form.tpl and

Show Detail

Display content with display.php and display.tpl in PrestaShop

I read http://doc.prestashop.com/display/PS16/Displaying+content+on+the+front+office and I try to create a display.php file and a display.tpl file. But I don't realize for sure where they must be ...

Show Detail

How to override tpl module in prestashop?

I'm working on a prestashop 1.7.4.2 project. I purchased the storelocator module (https://addons.prestashop.com/en/international-localization/18457-store-locator-with-google-maps.html). The main te...

Show Detail

prestashop 1.7.5 show product-discounts.tpl into miniatures/product.tpl

i have problems when i try to show product discounts into the miniatures of search results. I'm using prestashop 1.7.5.1 version and php 7.0 in templates/catalog/product.tpl y have the followin co...

Show Detail