Opencart 3.0.2.0 While refereshing Theme cache and SASS cache

I was getting error : Trying to access array offset on value of type null in C:\xampp\htdocs\testoc3020\storage\vendor.scss.inc.php on line 1753

Solution: I changed the code in following file in [your opencart storage folder]/vendor/scss.inc.php

in following function. code changed is orange color.

protected function sortArgs($prototype, $args) {
$keyArgs = array();
$posArgs = array();

foreach ($args as $arg) {
if(is_array($arg)){
list($key, $value) = $arg;
}
else {
$value = "";
}
$key = (is_array($key) && isset($key[1])) ? $key[1] : null;
if (empty($key) || is_null($key)) {
$posArgs[] = $value;
} else {
$keyArgs[$key] = $value;
}
}

if (!isset($prototype)) return $posArgs;

$finalArgs = array();
foreach ($prototype as $i => $names) {
if (isset($posArgs[$i])) {
$finalArgs[] = $posArgs[$i];
continue;
}

$set = false;
foreach ((array)$names as $name) {
if (isset($keyArgs[$name])) {
$finalArgs[] = $keyArgs[$name];
$set = true;
break;
}
}

if (!$set) {
$finalArgs[] = null;
}
}

return $finalArgs;
}

Popular posts from this blog

Cant use dump() function in twig files or how to enable debug in opencart twig or print_r alternate use dump() in opencart 3.0

maximum execution time error when importing sql data file since php.ini has been already set max execution time 3000

SEO Custom URL in Opencart