Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Worldpay hosted payments - php7


Recommended Posts


installing wordplay hosted payments 2.2 on CE bootstrap 4 with php - 7.2.14

There are a couple of depreciated PHP elements in  includes/modules/payment/rbsworldpay_hosted.php

The first  being line 16 - 

Function rbsworldpay_hosted {

I changed to 

function __construct() {

and that solved that one, but there is also a "Each" issue

line number 153

while (list(, $value) = each($order_total_modules->modules)) {

I have messed about with it but cannot get it to work, i know it has to be swapped around and be "foreach" but my amateur attempts are not working in this case

my last attempt is

foreach($order_total_modules->modules  as (array $value)) {

anyone with a bit more knowledge of PHP be able to correct it for me and the next person who will undoubtedly have the same issue

Thank you for looking




Link to comment
Share on other sites

Hi Rainer

Thanks for pointing towards some clues, and for that matter the compliment of thinking I knew how to understand them (if i understood emoji's i would put one in here with my head blowing up)

For anyone else looking for same i replaced the following

lines 152 and 153

      //    reset($order_total_modules->modules);
       //   while (list(, $value) = each($order_total_modules->modules)) {

with this
           foreach($order_total_modules->modules as $value) {

seems to be working as it should now but I am no expert, in fact far from it, so it may help you, but do your own research and test


kindest regards





Link to comment
Share on other sites

Link to comment
Share on other sites

Hi Gary

actually I first used the version included from the Master, but it stated it was v2 (in the shop), i already had V2.2 running on my other site so just assumed I would be better to download the latest from the add-ons.

In hindsight I should have known that despite it not showing as greater than v2 upon install into the shop that it would have been, could have saved myself a bit of time




Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...