Login Form

#213 – Show auction owner on bid page

Posted in ‘BF Auction’
This is a public ticket. Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.
Wednesday, 07 May 2014 00:55 AEST
picht
Joomla! version: 3.3.0

Is it possible to show the name of the user that created the auction on the bid page along with all the other info about the item ?

How would this be accomplished ?

Regards
Picht
 
Wednesday, 07 May 2014 21:20 AEST 25'
Tim
Everything Bundle, BF Quiz Plus 3 Years, BF Survey 12 Months
Hi Picht,

The uid field in jos_bfauction_plus will give you the id number of the person who created the auction item. You can then join this with the id field in the table to obtain their name (or username).

So to dispaly this on the bid view, first you'd need to adjust the query in the model file /components/com_bfauction_plus/models/bid.php so that it selects the information that you want to display.

In the getData funciton around line 88
$query = ' * FROM #__bfauction_plus '.
' WHERE id = '.$this->_id;

//change to
$query = $this->_db->getQuery(true);
$query->select('a.*, b.username');
$query->from('#__bfauction_plus AS a');
$query->join('LEFT', '#__users AS b ON b.id = a.uid');


Then in the view file /components/com_bfauction_plus/views/bid/tmpl/default.php, you could add something like:

<tr>
<td class="bfauction_plusLabel">
<label for="seller">
Seller:
</label>
</td>
<td class="bfauction_plusDetails">
<div class="bfauction_plusItemSeller"><?php echo $this->bfauction_plus->username; ?></div>
</td>
</tr>


I hope this helps.

regards

Tim
Follow us on twitter http://twitter.com/tamlynsoftware
Friday, 09 May 2014 17:13 AEST
picht
Hi

It workes great, Thanks !!

if someone else needs to make the change this line needs to be added tegether with the other query-lines (otherwise it will always use item with ID 1:
$query->where('a.id = '.$this->_id);


So it looks like this:
$query = $this->_db->getQuery(true);
$query->select('a.*, b.username');
$query->from('#__bfauction_plus AS a');
$query->where('a.id = '.$this->_id);
$query->join('LEFT', '#__users AS b ON b.id = a.uid');

Regards
Picht
 
Friday, 09 May 2014 17:50 AEST 5'
Tim
Everything Bundle, BF Quiz Plus 3 Years, BF Survey 12 Months
Hi Picht,
That's great that you got it working. Thanks for the tip to benefit anyone else who might want to try this.

regards

Tim
Follow us on twitter http://twitter.com/tamlynsoftware
This ticket is closed, therefore read-only. You can no longer reply to it. If you need to provide more information, please open a new ticket and mention this ticket's number.
Go to top