Highest bidder

Is there a feature that you would like to see added to Enuuk Auction Platform?
Post Reply
bamse
Posts: 220
Joined: Mon Feb 06, 2012 12:05 pm
Contact:

Highest bidder

Post by bamse » Tue Feb 07, 2012 3:34 pm

The program currently shows the name of the highest bidder. However all that matters for the user is whether he is winning the item or not.

Is it possible to change the highest bidder information to just a line saying "You are winning/losing"? Ideally this could be supported by colors (e.g. green/red font color or in a green/red box)?

RWAP
Site Admin
Posts: 748
Joined: Fri Jan 08, 2010 2:23 am
Location: Stoke-on-Trent
Contact:

Re: Highest bidder

Post by RWAP » Tue Feb 07, 2012 3:46 pm

You would merely need to change the line:

Code: Select all

<td><?=$offer->bids[0] ? $offer->bids[0]->user->id: '' ?></td>
to read:

Code: Select all

<td>
<? if ($offer->bids[0]) {
      if ($offer->bids->user-id==$loggedUser['id']) { ?>
            <span style="colour:green"><?=_('You are winning')?></span>
     <? } else { ?>
            <span style="colour:red"><?=_('You are losing')?></span>
<? } } ?>
</td>

bamse
Posts: 220
Joined: Mon Feb 06, 2012 12:05 pm
Contact:

Re: Highest bidder

Post by bamse » Tue Feb 07, 2012 5:53 pm

Thank you.

bamse
Posts: 220
Joined: Mon Feb 06, 2012 12:05 pm
Contact:

Re: Highest bidder

Post by bamse » Thu Mar 01, 2012 8:29 pm

The code works fine for users who have been participating in an auction.

However it displays "You are losing" also for not-logged in users and for users who have not participated in this particular auction.

So instead of checking whether there have been any bids (with the first "if"), it should be checked whether loggedUser has participated in the auction.

RWAP
Site Admin
Posts: 748
Joined: Fri Jan 08, 2010 2:23 am
Location: Stoke-on-Trent
Contact:

Re: Highest bidder

Post by RWAP » Thu Mar 01, 2012 8:45 pm

Ah - yes, that is true....

Try:

Code: Select all


<td>
<? if ($offer->bids[0] && $loggedUser) {
      $userTakenPart=false;
	  foreach ($offer->bids as $v){
      	if ($v->user->id==$loggedUser['id']) $userTakenPart=true;
      }
      if ($userTakenPart){
	      if ($offer->bids[0]->user->id==$loggedUser['id']) { ?>
	            <span style="colour:green"><?=_('You are winning')?></span>
	     <? } else { ?>
	            <span style="colour:red"><?=_('You are losing')?></span>
<? } } } ?>
</td>

bamse
Posts: 220
Joined: Mon Feb 06, 2012 12:05 pm
Contact:

Re: Highest bidder

Post by bamse » Thu Mar 01, 2012 9:57 pm

Thanks. This code works as expected if I leave out the "offer->"

RWAP
Site Admin
Posts: 748
Joined: Fri Jan 08, 2010 2:23 am
Location: Stoke-on-Trent
Contact:

Re: Highest bidder

Post by RWAP » Thu Mar 01, 2012 10:07 pm

Great - actually I realised looking back up the thread, it was never discussed where the code was to be used, so that explains why you need to leave out offer->

:lol:

bamse
Posts: 220
Joined: Mon Feb 06, 2012 12:05 pm
Contact:

Re: Highest bidder

Post by bamse » Fri Mar 02, 2012 1:03 pm

Indeed. It is being used in offerDetails....php

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest