Shop Error after PHP update to PHP Version 8.0

07.02.2022 11:16
#1
daswirdwas_design
Joomshopping forum user no avatar
Name: Andreas
29.11.2021
Posts: 2
Quote
Shop Error after PHP update to PHP Version 8.0

After automatic update of server PHP Version to PHP 8.0 by our service provider the following Warning apears in Site frontend:
Warning: Undefined variable $orderby in /var/www/xxxxxxxxx/html/CoS-AKTIV/components/com_jshopping/tables/category.php on line 28
and Article deatails couln't be opened (0 - Unsupported operand types: jshopProduct * float).
Returned manually to PHP 7.4 solves the problem but the PHP Version 7.4 will disabled by our provider latest Nov.2022. Soulution needed

Any Ideas whats the problem could be?

Current Joomla Version 3.10.5 , Joomshopping Version 4.18.7


Joomla: 3.10.5
JoomShopping: 4.18.7
PHP: 8.0 (current site now 7.4 again)
MySQL: 8.0.26-16
Website Url: https://colours-of-sound.com/
 
07.02.2022 11:42
#2
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25922
Quote
Aw: Shop Error after PHP update to PHP Version 8.0

1. components\com_jshopping\tables\category.php

function getSubCategories....

change to

function getSubCategories($parentId, $order = 'id', $ordering = 'asc', $publish = 0){
$lang = JSFactory::getLang();
$user = JFactory::getUser();
$add_where = ($publish)?(" AND category_publish = '1' "):("");
$groups = implode(',', $user->getAuthorisedViewLevels());
$add_where .=' AND access IN ('.$groups.')';
$orderby = "ordering";
if ($order=="id") $orderby = "category_id";
if ($order=="name") $orderby = "`".$lang->get('name')."`";
if ($order=="ordering") $orderby = "ordering";

$query = "SELECT `".$lang->get('name')."` as name,`".$lang->get('description')."` as description,`".$lang->get('short_description')."` as short_description, category_id, category_publish, ordering, category_image FROM `#__jshopping_categories`
WHERE category_parent_id = '".$this->_db->escape($parentId)."' ".$add_where."
ORDER BY ".$orderby." ".$ordering;
$this->_db->setQuery($query);
$categories = $this->_db->loadObjectList();
foreach($categories as $key=>$value){
$categories[$key]->category_link = SEFLink('index.php?option=com_jshopping&controller=category&task=view&category_id='.$categories[$key]->category_id, 1);
}
return $categories;
}

 
07.02.2022 11:45
#3
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25922
Quote
Aw: Shop Error after PHP update to PHP Version 8.0

2. Article deatails couln't be opened (0 - Unsupported operand types: jshopProduct * float).

Need details error.

Global Configuration / tab system
Debug System: yes

Send me error.


Last change: 07.02.2022 11:45
 


Copyrights MAXXmarketing GmbH. Alle Rechte vorbehalten
Durch die Nutzung dieser Website stimme ich zu, dass Cookies zur optimalen Gestaltung der Website sowie zur Analyse der Nutzung der Website verwendet werden. Weiterführende Informationen finden Sie hier. OK, einverstanden.