Hi Nicolas,
This is great I have it working nicely now - thank you. here is the working code so far:
<div id="modalcart">
<div class="modalmodel">
<?php
$class = hikashop_get('class.cart');
$cart = $class->loadFullCart();
$max = null;
foreach($cart->products as $product){
if($product->cart_product_modified>@$max->cart_product_modified){
$max = $product;
}
}
if($max){
$class = hikashop_get('class.product');
$product = $class->get($max->product_id);
echo $product->product_name;
}
?>
</div>
<div class="modalprice"><strong>Price: </strong>
<?php
foreach($cart->products as $product){
if($product->product_id!= $max->product_id) continue;
echo $product->prices[0]->price_value;
?>
</div>
<?php
$this->image = hikashop_get('helper.image');
$image = reset($product->images);
$height = $this->config->get('thumbnail_y');
echo $this->image->display($image->file_path,true,$image->file_name,'style="margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle"');
}
?>
</div>
</div>
I do still have one issue though... If I add a product with options ie. its a shoe site and you could select a black or grey or white shoe - when I add it - in the modal it has a bit of a freak out with the price... please see here >
heelcrush.com/collection.html
(Click Modern Crimp "BUY ME") Select a size and "BUY ME" in the modal that pops up the price is now crazy >> Price: 300.00000
Please help me