Sha256: 4a97783c6a59a4b44e3924dc39a61d95c909dbff4b9b8f15ff9253cabf2da78a
Contents?: true
Size: 743 Bytes
Versions: 10
Compression:
Stored size: 743 Bytes
Contents
module Spree Product.class_eval do def incountry?(country) clist = Spree::Zoned::Product.where "spree_product_id = ? AND spree_country_id = ?", id, country clist == [] || clist[0].orderno >= 0 end def delfrom(country) setorderno country, -1 end def backtocountry(country) setorderno country, 0 end protected def setorderno(country, ono) clist = Spree::Zoned::Product.where "spree_product_id = ? AND spree_country_id = ?", id, country if clist == [] zp = Spree::Zoned::Product.new zp.spree_country_id = country zp.spree_product_id = id else zp = clist[0] end zp.orderno = ono zp.save end end end
Version data entries
10 entries across 10 versions & 1 rubygems