Author Topic: Getting an error when clicking on a 'View Inventory' link?  (Read 3481 times)

Offline Daniel15

Getting an error when clicking on a 'View Inventory' link?
« on: January 28, 2006, 07:23:52 pm »
Note: This was for an OLD version of SMFShop (1.31). The contents of this post no longer apply to versions 1.31 and higher.

If you are getting an error when clicking on a 'View Inventory' link (something like 'ERROR: The member you typed ('1') doesn't exist!'), then you need to change  some code in your Display.template.php file.

Open Display.template.php
Find the old Inventory link. It will probably look something like this:
Code: [Select]
            //BEGIN SMFShop MOD 1.1 (Build 4) CODE
            echo "<a href='$scripturl?action=shop;do=invother2;membertype=id;member={$message['member']['id']}'>View Inventory</a><br>";
            //END SMFShop MOD 1.1 code

Replace it with the new code. This code is used since SMFShop 1.31 and looks something like this:
Code: [Select]
//BEGIN SMFShop MOD 1.31 (Build 7) CODE
echo "<a href='$scripturl?action=shop;do=invother2;member={$message['member']['username']}'>View Inventory</a><br>";
//END SMFShop MOD 1.31 code
This is due to a change in how the member name is passed to the View Inventory page (it used to be passed by ID, but is now passed by name).
« Last Edit: May 20, 2006, 09:08:29 am by daniel15 »

Offline Vi31

Re: Getting an error when clicking on a 'View Inventory' link?
« Reply #1 on: January 29, 2006, 12:34:13 am »
Thank you Daniel, that did it. :)

Offline Daethian

Re: Getting an error when clicking on a 'View Inventory' link?
« Reply #2 on: May 15, 2006, 01:17:16 pm »
I have the following code and when I replace it, I get a new error.

Code: [Select]
   //BEGIN Shop MOD 0.2 Code
echo '
', $txt[26], ': ', $message['member']['posts'], '<br />
';

            //I couldn't find where all these $message['member'][whatever] variables
            //are set, so I just send an extra database query to get the member's
            //money. Can someone tell me where (file and line) the $message variables
            //are set?
            global $ID_MEMBER, $db_prefix;

            $result_money = db_query("SELECT money
                                      FROM {$db_prefix}members
                                      WHERE ID_MEMBER = {$message['member']['id']}
                                      LIMIT 1", __FILE__, __LINE__);
            $row_money = mysql_fetch_array($result_money, MYSQL_ASSOC);

            echo $modSettings['shopCurrencyPrefix'].$row_money['money'].$modSettings['shopCurrencySuffix']."<br><br>";
            //END SHOP MOD
           

//BEGIN SMFShop MOD 1.31 (Build 7) CODE
echo "<a href='$scripturl?action=shop;do=invother2;member={$message['member']['username']}'>View Inventory</a><br>";
//END SMFShop MOD 1.31 code


New error
Code: [Select]
Unknown column 'inv.trading' in 'field list'
File: /home/purpleme/public_html/bb/Sources/shop/Shop.php
Line: 262

Offline Daniel15

Re: Getting an error when clicking on a 'View Inventory' link?
« Reply #3 on: May 20, 2006, 09:08:01 am »
Daethian,
 You don't need to replace anything. This was from an old version of SMFShop (1.31).

Anyway, it sounds like your SMFShop is not completely installed. What version are you using?

Offline Daethian

Re: Getting an error when clicking on a 'View Inventory' link?
« Reply #4 on: May 25, 2006, 11:03:35 am »
I just upgraded even though I had an error on remove topic.php that I can't fix.
The inventory is now working but I have another error.  I'm going to start a new thread for that.