MV Script to set item price to a variable

I've been using variables and switches to have a weight functionality in my game. It's been working well up until I decided I wanted an evented way for the player to discard an item. Then I run into the problem of how to retrieve the item weight. After searching the internet for plugins and not finding anything that quite matched my needs, I decided to use an item's "price" as the item's weight. Since there will be no shops in the game, this should work except that I can't quite get the code to retrieve the price to work!

The event has the player select an item, which is assigned to variable 8 (Item ID).
The Control Variables function sets variable 28 (Item Price) equal to the script:
$dataItems[$gameVariables.value(8)].Price;

I've tried several variations of this code but nothing returns the correct price. What am I doing wrong?
There's no property Price with a capital "P", it's just "price". If you replace that letter, the assignment should work correctly.
There's no property Price with a capital "P", it's just "price". If you replace that letter, the assignment should work correctly.
Oh my gosh!! *slaps head* THANK YOU!!! I knew it had to be something tiny and dumb that I was missing. Thank you so much. That was driving me nuts.
Pro tip. Next time you can open the dev console with f9 and type $dataItems there. This will display the exact member variable names of an object.

Original thread: https://forums.rpgmakerweb.com/threads/script-to-set-item-price-to-a-variable.156011/