I'm using amazon product advertising api.
So I'm getting notices like "Trying to get property of non-object". Can anyone tell me how to fix this?
Here is my code
if(!is_null($result->Items[0]->ItemAttributes->ListPrice->FormattedPrice) && $result->Items[0]->ItemAttributes->ListPrice->FormattedPrice != '0'){
$output_str .= '<span class="amazon-ad-listprice"><strong>List Price: </strong>'. $result->Items[0]->ItemAttributes->ListPrice->FormattedPrice .'</span>';
}
Here is the var_dump of that part
'ListPrice' => object AmazonProduct_Price (1)
protected _values -> array (3)
'Amount' => string (4) "3999"
'CurrencyCode' => string (3) "USD"
'FormattedPrice' => string (6) "$39.99"
I'm getting that notices only in products that doesn't have those values..
I've tried using isset(). But its not working.