You mean second ordinat which is for item count, right? I recommend to flag sold item in array but hey this is your game. Sell price usually has lower price tag for used item so probably 70% would be fair (you can adjust it later).
https://www.dropbox.com/s/f2eqnuxbrnm201c/shop%28functions%29.c3p?dl=0
theres a little problem, I can sell even if I have 0 of an item