Error from J3 to J4

  • Posts: 513
  • Thank you received: 8
  • Hikashop Business
1 year 7 months ago #344465

-- HikaShop version -- : 4.6.1
-- Joomla version -- : 4.2.0
-- PHP version -- : 8
-- Browser(s) name and version -- : CHROME
-- Error-message(debug-mod must be tuned on) -- : element->dhl_tracking)){echo ' Track your item: '.$this->element->dhl_tracking.'';}?> element->rm_tracking)){echo ' Track your item: '.$this->element->rm_tracking.'';}?> element->pf_tracking)){echo ' Track your item: '.$this->element->pf_tracking.'';}?>

Hi, I am using this code in J3 to supply our customers tracking numbers for parcels, it now does not work in J4 This is in customisation in order/show.php and

working code in J3:
<?phpif(!empty($this->element->dhl_tracking)){echo ' <strong>Track your item:</strong> <a href=" www.dhl.co.uk/en/express/tracking.html?AWB='.$this- >element->dhl_tracking.'">'.$this->element->dhl_tracking.'</a>';}?>
<?phpif(!empty($this->element->rm_tracking)){echo ' <strong>Track your item:</strong> <a href=" www.royalmail.com/track-your-item#/tracking-results/'.$this- >element->rm_tracking.'">'.$this->element->rm_tracking.'</a>';}?>
<?phpif(!empty($this->element->pf_tracking)){echo ' <strong>Track your item:</strong> <a href=" www.parcelforce.com/track-trace?trackNumber='.$this- >element->pf_tracking.'">'.$this->element->pf_tracking.'</a>';}?>

Now gives this error message in J4:
element->dhl_tracking)){echo ' Track your item: '.$this->element->dhl_tracking.'';}?> element->rm_tracking)){echo ' Track your item: '.$this->element->rm_tracking.'';}?> element->pf_tracking)){echo ' Track your item: '.$this->element->pf_tracking.'';}?>

I'm guessing something in the code needs changing?

thanks

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 81481
  • Thank you received: 13062
  • MODERATOR
1 year 7 months ago #344467

Hi,

You need a space between the "<?php" and the "if". I don't think it's linked to your version of Joomla but to your version of PHP. PHP8 is stricter than PHP 7 and no space between the <?php and the PHP code is not something I would recommend and that's probably why you get that display as PHP 8 now thinks your <?phpif is just a normal HTML tag.

Please Log in or Create an account to join the conversation.

Time to create page: 0.046 seconds
Powered by Kunena Forum