refactored buybutton code in shopgroup