1
 {% set i = 0 %}

 {% set i = i + 1 %}

 {% if i % 2 == 0 %}

i am trying to change this set and i operator to change this code . this is the twig file code . how can we write this code in tpl file .I am facing problem to solve condition operators like this specially f i % in above three codes . mean how can i convert this line in tpl exactly. i am converting opencart 3.0.2.0 theme into opencart 2.3.0.2 . i tired my best to understand how to change this code in tpl but could't manage to solve it . thanks

alexander.polomodov
  • 5,396
  • 14
  • 39
  • 46
  • You can convert your Twig code to PHP or TPL here : https://www.easycodetools.com/tool/twig-to-php-converter here, is online twig to PHP converter ( online twig to TPL converter ) – Bhavik Hirani Apr 10 '23 at 07:21

1 Answers1

1

You can write above code in .tpl like this

<?php 
$i = 0;
$i++;
if($i%2==0){}
?>
Radhika
  • 533
  • 5
  • 22