m trying 2 modify the cart 2 show the dimension of the products without adding custom fields 2 every product.
Here is the problem, im using version 4.02

Warning: Illegal offset type in includes\display\ProductDetails.php on line 39

the code in productdetails.php that makes the error is:

if($product[$dimensions] > 0) {

and the full code

$product = $GLOBALS['ISC_CLASS_PRODUCT']->GetProduct();
$dimensions = array(
    'ProductHeight' => 'prodheight',
    'ProductWidth' => 'prodwidth',
    'ProductDepth' => 'proddepth'
);
foreach($dimensions as $global => $field) {
    if($product[$dimensions] > 0) {
        $GLOBALS[$global] = FormatWeight($product[$field], false);
        $hasDimensions = true;
    }
    else {
        $GLOBALS['Hide'.$global] = 'display: none';
    }
}

if(!isset($hasDimensions)) {
    $GLOBALS['HideDimensions'] = 'display: none';
}

i think is something 2 do with FormatWeight in class.product.php i attached the file cuz is 2 big

    Looks like you probably want to use $field as the array index instead of $dimensions?

      it worked with $field ty so much 🙂

        Write a Reply...