Author Topic: SP one step checkout php 7.2 deprecate issue  (Read 623 times)

Offline sundar

  • Site Manager
  • Hero Member
  • *****
  • Posts: 249
  • Total likes: 1
  • Karma: +1/-0
  • Gender: Male
  • Thirsty Knowledge...
    • View Profile
    • Can talk anything
SP one step checkout php 7.2 deprecate issue
« on: September 21, 2020, 02:47:08 AM »
PHP Deprecated:  Function create_function() is deprecated in /home/smithikakart/public_html/modules/spstepcheckout/spstepcheckout.php on line 3221

Fixed by changing this line 3221

From :


Quote
{
      usort($array, create_function('$a, $b', '
         $a = $a["' . $field . '"];
         $b = $b["' . $field . '"];


         if ($a == $b) return 0;


         return ($a < $b) ? -1 : 1;
      '));


      return true;
   }

To



   
Code: [Select]
{
usort($array, function($a, $b){
$a = $a["' . $field . '"];
$b = $b["' . $field . '"];


if ($a == $b) return 0;


return ($a < $b) ? -1 : 1;
} );


return true;
}
Always TAG your threads

  • Download all the schematics here Direct download
  • Stay connected with S4talk on

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal