Post by kakanis » Wed Jul 08, 2020 1:56 pm

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?
Last edited by kakanis on Wed Jul 08, 2020 8:07 pm, edited 1 time in total.

User avatar
New member

Posts

Joined
Thu Jul 25, 2019 2:36 pm

Post by letxobnav » Wed Jul 08, 2020 4:17 pm

MAYBE check your error logs

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by paulfeakins » Wed Jul 08, 2020 6:44 pm

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.

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Guru Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by kakanis » Wed Jul 08, 2020 8:06 pm

Yes thanks, had to sort data in controller.

User avatar
New member

Posts

Joined
Thu Jul 25, 2019 2:36 pm

Post by paulfeakins » Thu Jul 09, 2020 5:44 pm

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.

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Guru Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom
Who is online

Users browsing this forum: No registered users and 19 guests