Creating a log is pretty easy. Printing it is a little harder, but to create a log just create a db table called
{whatever your db_prefix is}, probably smf_, shop_logs
(so if it is smf_ it would be smf_shop_logs)
the table should have log_id(an int) user_id(an int) item_id(an int) and date(an int)
then find this part of code
else
{
mysql_free_result($result);
// Put item in user's inventory
db_query("
INSERT INTO {$db_prefix}shop_inventory
(ownerid, itemid, amtpaid)
VALUES (
{$ID_MEMBER},
{$_GET['id']},
{$row['price']})", __FILE__, __LINE__);
// Decrease user's money
db_query("
UPDATE {$db_prefix}members
SET money = money - {$row['price']}
WHERE ID_MEMBER = {$ID_MEMBER}
LIMIT 1",
__FILE__, __LINE__);
// Decrease stock by 1
db_query("
UPDATE {$db_prefix}shop_items
SET stock = stock - 1
WHERE id = {$_GET['id']}
LIMIT 1", __FILE__, __LINE__);
and add
$date = date('mdHi');
db_query("
INSERT INTO {$db_prefix}shop_logs
(owner_id, item_id, date)
VALUES
({$ID_MEMBER}, {$_GET['id']}, {$date})
", __FILE__, __LINE__);
that should work. You can then access logs through phpmyadmin or write code to accomplish it for you,