Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/solidusio-contrib/solidus_asset_variant_options
A Solidus extension to reuse images across variants.
https://github.com/solidusio-contrib/solidus_asset_variant_options
ecommerce extension image multiple-variants product solidus variant
Last synced: about 1 month ago
JSON representation
A Solidus extension to reuse images across variants.
- Host: GitHub
- URL: https://github.com/solidusio-contrib/solidus_asset_variant_options
- Owner: solidusio-contrib
- License: bsd-3-clause
- Created: 2015-05-27T20:18:31.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-12-04T16:49:09.000Z (about 1 year ago)
- Last Synced: 2024-12-20T14:33:01.857Z (about 1 month ago)
- Topics: ecommerce, extension, image, multiple-variants, product, solidus, variant
- Language: Ruby
- Homepage:
- Size: 107 KB
- Stars: 10
- Watchers: 5
- Forks: 15
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Solidus Asset Variant Options
=============================[![CircleCI](https://circleci.com/gh/solidusio-contrib/solidus_asset_variant_options.svg?style=svg)](https://circleci.com/gh/solidusio-contrib/solidus_asset_variant_options)
Adds the ability for admins to use the same image asset for multiple variants.
Originally a fork of [jpdesigndev/spree_asset_variant_options](https://github.com/jpdesigndev/spree_asset_variant_options).Installation
------------Add solidus_asset_variant_options to your Gemfile:
```ruby
gem "solidus_asset_variant_options"
```Bundle your dependencies and run the installation generator:
```shell
bundle
bundle exec rails g solidus_asset_variant_options:install
```Since this extension changes the way images are associated, if you've got any
existing ones you'll need to add the association back in. This can be
accomplished by running:```ruby
Spree::Image.find_each do |image|
if image.viewable_type == "Spree::Variant"
image.variants << image.viewable
end
end
```Afterwards it is recommended to consolidate the images in the admin.
Testing
-------First bundle your dependencies, then run `rake`. `rake` will default to
building the dummy app if it does not exist, then it will run specs. The dummy
app can be regenerated by using `rake test_app`.```shell
bundle exec rake
```When testing your applications integration with this extension you may use it's factories.
Simply add this require statement to your spec_helper:```ruby
require "spree_asset_variant_options/factories"
```