Post by jonkers20 » Sat Jan 26, 2019 3:56 am

hello I am working on a module of 2.x which to 3.x.
But I can not get this php to twig properly

Code: Select all

<php array_unshift($stock_statuses, array('stock_status_id' => 0, 'name' => '' )); foreach ($stock_statuses as $stock_status) { ?>

Newbie

Posts

Joined
Sat Jan 26, 2019 3:51 am

Post by straightlight » Sat Jan 26, 2019 11:31 pm

Partial code posted; complete solution needed. Forum rules.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by JNeuhoff » Sat Jan 26, 2019 11:40 pm

Perhaps the Twig merge filter can accomplish the same thing.

Or you can keep it as a PHP template and use our Template Switcher PHP/Twig to also support PHP templates in OpenCart 3.

MHC Web Design
Override Engine * Integrated VQMod * Multilingual SEO * Instant Option Price Calculator * TrustPilot Reviews * Google Rich Snippets * Google Tag Manager * Export/Import Tool * Template Switcher PHP/Twig


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by letxobnav » Sat Mar 09, 2019 4:38 pm

In my opinion you should keep data logic in the controller and display logic in the views.

Crystal Light Centrum Taiwan


Active Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm

Post by straightlight » Sat Mar 09, 2019 11:34 pm

Also:

Code: Select all

<php
for:

Code: Select all

<?php

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 3 guests