dsp77 Posted February 19, 2009 Share Posted February 19, 2009 im working in modifying interspire cart to show the dimensions to but i get this error Warning: Illegal offset type in includes\display\ProductDetails.php on line 39 the code from that line 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'; } im out of options right ty for help Link to comment https://forums.phpfreaks.com/topic/145892-warning-warning-illegal-offset-type/ Share on other sites More sharing options...
Mark Baker Posted February 19, 2009 Share Posted February 19, 2009 $dimensions is an array itself, so it can't be used as an index for an array element. Do you mean $product[$global] or $product[$field] Link to comment https://forums.phpfreaks.com/topic/145892-warning-warning-illegal-offset-type/#findComment-766239 Share on other sites More sharing options...
dsp77 Posted February 20, 2009 Author Share Posted February 20, 2009 it worked with $field ty so much Link to comment https://forums.phpfreaks.com/topic/145892-warning-warning-illegal-offset-type/#findComment-766917 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.