Post by glolar » Tue Sep 21, 2021 3:51 pm

Hello all,

I am using the ZEMEZ Store Theme with OpenCart 3.0.2.0. When my server is set to use PHP 7.3.30, everything displays perfectly. However, if I set the PHP version to 7.4.23, one of the divs on the home page does not get displayed. Using the browser tools, I can see that when PHP 7.3.30 is running, the div looks like this:

<div class="tm-container container">

and the div gets displayed correctly. However, when PHP 7.4.23 is running, the div looks like this:

<div class="tm-containercontainer">

and the div does not get displayed. Notice the missing space between "tm-container" and "container" in the <div> above.

Here is the code in the .twig file that displays this part of the site:

<div class="tm-container {% if (row.fullwidth == '0') %} {{ "container" }} {% endif %}" {{ row.attrs }}>
<div class="tm-inner">
{% endif %}
<div class="row row-level-{{ row.level }} {{ row.sfxcls }}">
<div class="row-inner {{ row.cls }} clearfix">

The final line in the code above is also getting the space dropped after the "row-inner" when PHP 7.4.23 is running, but not with PHP 7.3.30 running.

I am also attaching two screen captures. One shows the div correctly (containing the three green sections for FREE SHIPPING & RETURN, MONEY GUARANTEE and ONLINE SUPPORT. The other shows the div not being displayed correctly. The relevant line of code is highlighted in both images.

When PHP 7.3.30 is deprecated on my web host's server, my site will be broken, so if anyone has a solution, I would be grateful. I did edit the file and made sure there were actual spaces where there was supposed to be, and not whitespace, so I am baffled that PHP 7.4.23 is doing this. Everything else on the site appears to be working OK.

The site can be seen at www.glanzceramic.com/store, and PHP 7.3.30 is currently running, so if you scroll down toward the bottom, you can see the green section that I am talking about.

Thanks in advance for the help!

Larry

Attachments

oc_good.jpg

oc_good.jpg (366.27 KiB) Viewed 1291 times

oc_bad.jpg

oc_bad.jpg (293.74 KiB) Viewed 1291 times

Last edited by glolar on Tue Sep 21, 2021 7:40 pm, edited 2 times in total.

User avatar
Active Member

Posts

Joined
Thu Jul 29, 2010 12:35 pm
Location - San Diego, CA

Post by thekrotek » Tue Sep 21, 2021 5:14 pm

Contact theme developer.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by JNeuhoff » Tue Sep 21, 2021 5:16 pm

OC 3.0.2.0 uses quite an old version of Twig (V1.24) which has issues with PHP 7.4 or PHP 8.

You should upgrade to a newer version of OpenCart, such as OC 3.0.3.8, which uses a newer version of Twig (V2.13.0). That one should support newer PHP versions, too.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by ADD Creative » Tue Sep 21, 2021 5:18 pm

I believe the issue is that the version of Twig that comes with that version of OpenCart is not compatible with PHP 7.4.

There some workaround posted on the forum.
viewtopic.php?t=217222#p827215
viewtopic.php?t=222918&start=20#p816612

Other options would be to upgrade Twig, upgrade OpenCart or stick to PHP 7.3 providing you host uses a version with the security patches back ported.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by glolar » Tue Sep 21, 2021 5:21 pm

thekrotek wrote:
Tue Sep 21, 2021 5:14 pm
Contact theme developer.
I already have. They are not very responsive. I wasted 4 days trying to figure out why my page was missing a div, because their product page didn't specify what version(s) of PHP their theme was compatible with.

Increase Your Child's I.Q.
iPad Wallpapers
Turtle & Tortoise Screen Savers


User avatar
Active Member

Posts

Joined
Thu Jul 29, 2010 12:35 pm
Location - San Diego, CA

Post by paulfeakins » Tue Sep 21, 2021 5:43 pm

glolar wrote:
Tue Sep 21, 2021 5:21 pm
thekrotek wrote:
Tue Sep 21, 2021 5:14 pm
Contact theme developer.
I already have. They are not very responsive. I wasted 4 days trying to figure out why my page was missing a div, because their product page didn't specify what version(s) of PHP their theme was compatible with.
That is not the problem. Read the other replies above about the Twig version.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by glolar » Tue Sep 21, 2021 6:18 pm

paulfeakins wrote:
Tue Sep 21, 2021 5:43 pm
glolar wrote:
Tue Sep 21, 2021 5:21 pm
thekrotek wrote:
Tue Sep 21, 2021 5:14 pm
Contact theme developer.
I already have. They are not very responsive. I wasted 4 days trying to figure out why my page was missing a div, because their product page didn't specify what version(s) of PHP their theme was compatible with.
That is not the problem. Read the other replies above about the Twig version.
I did read the other replies. I was simply answering TheKrotek's reply about contacting the theme developer.

I have already implemented the coding change to the Lexer.php file and that fixed my issue.

Increase Your Child's I.Q.
iPad Wallpapers
Turtle & Tortoise Screen Savers


User avatar
Active Member

Posts

Joined
Thu Jul 29, 2010 12:35 pm
Location - San Diego, CA

Post by glolar » Tue Sep 21, 2021 6:20 pm

ADD Creative wrote:
Tue Sep 21, 2021 5:18 pm
I believe the issue is that the version of Twig that comes with that version of OpenCart is not compatible with PHP 7.4.

There some workaround posted on the forum.
viewtopic.php?t=217222#p827215
viewtopic.php?t=222918&start=20#p816612

Other options would be to upgrade Twig, upgrade OpenCart or stick to PHP 7.3 providing you host uses a version with the security patches back ported.
Wow, thanks for the help. I didn't want to install VQMod, so I made the changes to the Lexer.php file mentioned in the second post that you linked, and that fixed the issue. You da' man!

Increase Your Child's I.Q.
iPad Wallpapers
Turtle & Tortoise Screen Savers


User avatar
Active Member

Posts

Joined
Thu Jul 29, 2010 12:35 pm
Location - San Diego, CA

Post by glolar » Tue Sep 21, 2021 6:25 pm

JNeuhoff wrote:
Tue Sep 21, 2021 5:16 pm
OC 3.0.2.0 uses quite an old version of Twig (V1.24) which has issues with PHP 7.4 or PHP 8.

You should upgrade to a newer version of OpenCart, such as OC 3.0.3.8, which uses a newer version of Twig (V2.13.0). That one should support newer PHP versions, too.
I am very tempted to update to OC 3.0.3.8, but I am so close to my client's deadline that I don't want to risk that right now. No telling what issues that might cause with the vendors template. For now, I just made the changes to the Lexer.php file that were linked in another poster's reply, and that seems to have fixed my immediate issues.

Thanks so much for help. I will probably do some research to see if I can update the version of Twig that OC 3.0.2.0 is using (suggested by another poster).

Increase Your Child's I.Q.
iPad Wallpapers
Turtle & Tortoise Screen Savers


User avatar
Active Member

Posts

Joined
Thu Jul 29, 2010 12:35 pm
Location - San Diego, CA

Post by JNeuhoff » Tue Sep 21, 2021 6:33 pm

I am so close to my client's deadline that I don't want to risk that right now.
I can understand that, I have been in the same situation in past projects.

I just made the changes to the Lexer.php file that were linked in another poster's reply, and that seems to have fixed my immediate issues.
Glad to hear you managed to fix it. Could you please so kind to add '[SOLVED]' to this forum thread title of your first post? Thanks.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am

Who is online

Users browsing this forum: SohBH and 272 guests