SMF Shop
SMFShop => Coding => Topic started by: Iehova on October 21, 2006, 06:48:16 am
-
Sorry, that wasn't a very descriptive title.
What I'm looking for is to have it so that when a member purchases an item from the shop the money is sent to a specific account, rather than simply disappearing.
Can anyone help? The sooner I get this sorted the better. :)
Thanks,
Iehova
-
Interesting idea! Also very simple to code =D.
Ok. Open Shop-Buy.php
Find a line like this:
$result = db_query("UPDATE {$db_prefix}members
SET money = money - {$row['price']}
WHERE ID_MEMBER = {$ID_MEMBER}
LIMIT 1",
__FILE__, __LINE__);
Add this:
$result = db_query("UPDATE {$db_prefix}members
SET money = money + {$row['price']}
WHERE ID_MEMBER = XXXX
LIMIT 1",
__FILE__, __LINE__);
Where XXXX is the ID of the specific account you want to give the money to.
-
I have thought of implementing this before, mainly for a lottery style item, where users purchase lottery tickets, and the sales go into a lottery user account. then the lottery is drawn, and then winner receives the winnings from the account.
I would imagine that to implement this, you would have to go into the shop-buy script, and find where it takes the users money, then add a quick db query to add the same amount to a particular account. Daniel15 or Basil would be able to confirm this.
*Edit* Damn, beaten to it. Told you daniel15 or basil would be the ones!!
-
You guys are absolutely AWESOME, thank you so much! :D