4,474 questions
0
votes
1
answer
43
views
How can I fix error Notice: Trying to access array offset on value of type null in Prestashop 1.7.8.11
I´m configuring Prestashop 1.7.8.11 and when I click in the Checkout for proccess to payment, I recive this error:
in 5e15b4d1179cdfd15539bcc9dbefe763da3b3d2b_2.file.cart-summary-totals.tpl.php line ...
0
votes
1
answer
80
views
Translate and combine a PHP string array using Smarty
I'm working on come code that uses Smarty for templating. I have a php function that creates an array of strings, and this function is called from a Smarty { } block. Within that Smarty block I need ...
1
vote
1
answer
62
views
Prestashop 1.7 Add ISBN value from product table to delivery-slip.tpl
Let me try to explain what I'm looking for:
We use the ISBN field in products options for adding packing size information. Everything is fine when the order is passed directly in Prestashop. But when ...
0
votes
0
answers
532
views
Fatal error: Uncaught Error: Class "Smarty" not found
I am new to this PHP and .tpl thing, And I found a template on this website. When openup the XAMPP Apache server, when I go to localhost/terminal, I get this error :
Fatal error: Uncaught Error: ...
1
vote
0
answers
751
views
PHP8.3 + Smarty 5.0 and Explode/Implode
<b>Deprecated</b>: Using implode is deprecated. Use join using the array first, separator second.
I'm getting the same deprecation warning with explode, telling me to use split.
Is this ...
0
votes
1
answer
66
views
Inline css not being applied/used in smarty template for sending mail
I work on the website archi-wiki,org, we have a weekly mail and I'm doing the css for it. Unfortunatly, we use smarty template for this mail and I haven't found a way to use css other than inline css.
...
0
votes
1
answer
84
views
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'demostore.ps_bids' doesn't exist
i created an updatebids.php where given the case, if certain amount of users share the same bet, this has to update to 1 extra euro/dollar. In the picture even same user can bet the same amount :/
...
0
votes
1
answer
127
views
Prestashop 1.7: display categories list in tpl file
I want to display a list of categories in the tpl file of the 404 page.
The categories to be shown are accessible in this array:
$categories Array (5)
0 => Array (4)
id_category => &...
0
votes
1
answer
207
views
Adding Smarty Template to Docker Compose File?
I am very new to this, but trying to learn Docker. I have my apache server running from the below Compose file and now I want to install Smarty template tool.
I am trying to get a portable container ...
0
votes
1
answer
392
views
If Else Operations doesnt work in .tpl file
I have this tpl file code which will represent 2 factor authentication validation
<form
action="../tiki-two_factor_validator.php"
method="POST">
<div ...
0
votes
2
answers
135
views
How to compare two different date AND timestamps in smarty
I can't find a solution to this:
I only want to compare two date and timestamps with eachother like this ->
{if $CONFIG.ENDDATE lte $smarty.now|date_format:"%Y%m%d %H:%M"}
$CONFIG....
2
votes
1
answer
4k
views
Why will Smarty remove Support for using PHP Functions as Modifiers?
After switching to PHP 8.2 and Smarty 4.3,
I get a lot of deprecation warnings like
PHP Deprecated: Using php-function "substr" as a modifier is deprecated and will be removed in a future ...
1
vote
0
answers
236
views
How to add Google Tag Manager to Prestashop v. 1.7.7
I added the script code to the head in layout-both-columns.tpl with {literal} tags and the noscript right under the body id="{$page.page_name}" class="{$page.body_classes|classnames}&...
1
vote
1
answer
135
views
Get from a smarty variable the day of week
I want add condition to a variable if the day of this condition is a Monday,
Example:
{if $order.details.order_date == monday}
{$order.details.order_date|replace:'/':'-'|cat:' +8 days'|date_format:'%...
0
votes
0
answers
58
views
Prestashop custom module tpl getting html encoded
I have created my first custom prestashop(v8) module. For some reason the tpl file is getting html encoded in the website frontend. I inspected the site code and noticed the tpl file content is ...
0
votes
0
answers
84
views
KISS with {include} or fancy code with {extends}
I'm a backend (PHP) developer, but I have converted some (static) HTMLs to dynamic templates (for different people, with different levels of coding knowledge).
It doesn't matter which template engine ...
0
votes
1
answer
30
views
ERRNO: 2 TEXT: define() expects at least 2 parameters, 1 given
ERRNO: 2
TEXT: define() expects at least 2 parameters, 1 given
class Link
{
public static function Build($link)
{
$base = 'http://' . getenv('SERVER_NAME');
// If HTTP_SERVER_PORT is defined and ...
2
votes
0
answers
294
views
Smarty {php} tag issue: Need suggestions for more productive migration from old Smarty to v4.3.1
I'm helping a friend to migrate their PHP project to the latest PHP 8.2.4. As he also uses Smarty v2.6.19, I'll have to help him to upgrade to v4.3.1, which is the latest version of Smarty. ...
0
votes
1
answer
287
views
Creating smarty function for use in template
Having trouble following the very simple example for creating a function to use in my template. I'm hoping in the end to just be able to use this as a means to get data for a menu.
I've butchered the ...
1
vote
1
answer
132
views
Get PHP data on TPL file
I am new to WHMCS and php and i would like to add a new custom php file that displays all the tlds and their pricing ...
For that, i have created a new file : domainList.php under /public_html/ ...
0
votes
1
answer
93
views
Smarty template engine is displaying css code
Hello i am trying to add options to a select but smarty is outputting the css code as a string.I cant get it to work with php or javascript, I am using this function to replace the html
function ...
1
vote
0
answers
114
views
Shoper - Displaying of variants in the product list
I want to display the available variants in the product list so that when I click on a variant, the main picture changes with a preview of what the variant looks like. I also want only the first 5 ...
0
votes
2
answers
131
views
If statement inside include tag, smarty?
I want to have an if statement (or something that can do the following functionality) inside a include tag in smarty. I have the following include tag:
{include
file="controls/...
0
votes
1
answer
171
views
Smarty is not expiring or overwriting its compiled and cached templates
I am using Smarty (latest version v4.3.0) for my PHP project. is not expiring or overwriting its compiled and cached templates. I have explicitly defined a NO-CACHE behaviour. The code for that is:
// ...
0
votes
1
answer
966
views
Error: the templates_c directory does not exist or is not writable
When launching my web application on local EasyPHP web server, I am still getting this :
Error: the templates_c directory does not exist or is not writable
Please make sure that the templates_c ...