spree - product can have only one taxonomy -


i working on spree , want make changes in admin panel admin can add 1 taxonomy(primary category) , correspondingly add more tertiary categories (taxons) come taxonomy. how should proceed this?

if follow, want have max 1 root taxonomy in admin section. when admin tries create new one, action should blocked. if can done on different ways. try this:

  • block creating new taxon if there taxon in database - override spree taxon model, might use before_create callback , check if root taxon in db , block creation.
  • in templates can override admin taxon index , hide add taxon button if there taxon already

Comments