Search code examples
spree

How to add images to taxonomies in spreecommerce


I want to set up product categories (or "taxonomies" as spreecommerce calls them) containing products.

Is there a way to add a photo to each of them so I can show them in some sort of overview?


Solution

  • Spree::Taxon supports an icon as shown here:

    https://github.com/spree/spree/blob/v3.0.2/core/app/models/spree/taxon.rb#L26-L31

    If that doesn't work for your purposes you can add another paperclip image to the model following the Logic Customization Guide, then adding it to the view where you want to show the photo as shown in the View Customization Guide.