if (!VmConfig::get('css', TRUE)) {
return FALSE;
}
Move these 3 lines up after if ($cssFile) return; on line 879(...)
static $cssSite;
if ($cssSite) return;
if (!VmConfig::get('css', TRUE)) {
return FALSE;
}
// we load one common css and put styles in there
(...)
// Make sure we have an array to work with.
$allPrices = (isset($this->product->allPrices) && is_array($this->product->allPrices))
? $this->product->allPrices
: [];
// Polyfill for array_key_first for older PHP (<7.3).
if (!function_exists('array_key_first')) {
function array_key_first(array $arr) {
foreach ($arr as $k => $_) { return $k; }
return null;
}
}
echo "Lowest price:<br>";
if (!empty($allPrices)) {
// Initialize with the first key.
$lowestKey = array_key_first($allPrices);
// Walk the array to find the lowest product_price.
foreach ($allPrices as $k => $row) {
if (!isset($row['product_price'])) {
continue;
}
if (
!isset($allPrices[$lowestKey]['product_price']) ||
(float)$row['product_price'] < (float)$allPrices[$lowestKey]['product_price']
) {
$lowestKey = $k;
}
}
$lowestPrice = isset($allPrices[$lowestKey]['product_price'])
? (float)$allPrices[$lowestKey]['product_price']
: null;
echo $lowestPrice !== null ? number_format($lowestPrice, 2) : 'N/A';
} else {
echo 'N/A';
}
Page created in 0.073 seconds with 15 queries.