Page 1 of 1

Twig new features does not work in opencart [SOLVED]

Posted: Wed Jul 08, 2020 1:56 pm
by kakanis
I want to sort my view in opencart with new twig feature, but when I do so page stops working with server 500 error.

Code: Select all

{% for name in manufacturer_names|sort((a, b) => a.order_no <=> b.order_no) %}
     ...SOME SORTED CODE INSIDE
{% endfor %}
MAYBE opencart does not support new twig functionality?

Re: Twig new features does not work in opencart

Posted: Wed Jul 08, 2020 4:17 pm
by letxobnav
MAYBE check your error logs

Re: Twig new features does not work in opencart

Posted: Wed Jul 08, 2020 6:44 pm
by paulfeakins
kakanis wrote:
Wed Jul 08, 2020 1:56 pm
MAYBE opencart does not support new twig functionality?
Check what version of Twig supports that syntax and check what version of Twig OpenCart has.

Re: Twig new features does not work in opencart

Posted: Wed Jul 08, 2020 7:43 pm
by JNeuhoff
Current OpenCart 3.0.x releases still use an old version of Twig.

Re: Twig new features does not work in opencart

Posted: Wed Jul 08, 2020 8:06 pm
by kakanis
Yes thanks, had to sort data in controller.

Re: Twig new features does not work in opencart

Posted: Thu Jul 09, 2020 5:44 pm
by paulfeakins
kakanis wrote:
Wed Jul 08, 2020 8:06 pm
Yes thanks, had to sort data in controller.
Please add [SOLVED] to the beginning if it is then.