Modified to work in Shopp 1.2.x