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 Quote 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] Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.