Jump to content

Edit History

WisQQ

WisQQ

Dnia 14.02.2023 o 12:11 PM, Musterheld napisał:
$cover = isset($product['default_image']) ? $product['default_image'] : $product['cover'] ?: Helper::getNoImage();

 

It's one line if statement and the ':' is else. But as you can see it's used twice and before second there is question mark which indicates another if. I think this is the one messing up order validation. Try to change it to normal if elseif and see if it works. Then you can change it back to oneliner.
 

if(isset($product['default_image']))
{
	$cover = $product['default_image'];
}elseif(isset($product['cover'])){
	$cover = $product['cover'];
}else{
	$cover = Helper::getNoImage();
}

 

WisQQ

WisQQ

Dnia 14.02.2023 o 12:11 PM, Musterheld napisał:
$cover = isset($product['default_image']) ? $product['default_image'] : $product['cover'] ?: Helper::getNoImage();

 

It's one line if statement and the ':' is else statement. But as you can see it's used twice in this line. Try to change it to normal if elseif else and see if it helps.
 

if(isset($product['default_image']))
{
	$cover = $product['default_image'];
}elseif(isset($product['cover'])){
	$cover = $product['cover'];
}else{
	$cover = Helper::getNoImage();
}

 

×
×
  • Create New...