Hi everyone!
My script below are looping out value of bids and date and works fine.
I want to make a function with this script to only show the latest value in the loop or the highest value.
Hope you can help me, I’m in a little bit hurry.
BIG THANKS IN ADVANCED!
<?php if ( !empty( $obj->Bids->Bid) ) {
$counter = 0;
$bids = is_array($obj->Bids->Bid) ? $obj->Bids->Bid : array($obj->Bids->Bid);
?>
<div id="fasad-description-bidhistory">
<h3><?= __('Bid history', 'fasad-starter');?></h3>
<ul id="fasad-bidhistory-item-list" class="fasad-list">
<?php foreach ( $bids as $index => $bid) : ?>
<li>
<?php echo ($index+1) ?> <br>
<?= __('Bid', 'fasad-starter');?>: <?php echo number_format($bid->amount, 0, '', ' ')?> <?= __('SEK', 'fasad-starter');?> <br>
<?= __('Date', 'fasad-starter');?>: <?php echo $bid->date; ?>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php } ?>