{"id":25254236,"url":"https://github.com/alchemycms/alchemy-solidus","last_synced_at":"2025-04-09T23:15:49.687Z","repository":{"id":2875654,"uuid":"47715908","full_name":"AlchemyCMS/alchemy-solidus","owner":"AlchemyCMS","description":"AlchemyCMS Solidus Integration","archived":false,"fork":false,"pushed_at":"2025-04-08T09:19:38.000Z","size":555,"stargazers_count":32,"open_issues_count":1,"forks_count":30,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-09T23:15:41.494Z","etag":null,"topics":["alchemy","cms","ecommerce","frontend","solidus"],"latest_commit_sha":null,"homepage":"https://alchemy-cms.com","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlchemyCMS.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-12-09T20:08:38.000Z","updated_at":"2025-04-08T09:19:40.000Z","dependencies_parsed_at":"2024-02-10T23:31:50.148Z","dependency_job_id":"e288b4aa-3d44-493f-b163-1d86ef3cfbdf","html_url":"https://github.com/AlchemyCMS/alchemy-solidus","commit_stats":{"total_commits":312,"total_committers":19,"mean_commits":16.42105263157895,"dds":"0.22435897435897434","last_synced_commit":"810ca0ee49568800542409a5a681cf7f6823748c"},"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlchemyCMS%2Falchemy-solidus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlchemyCMS%2Falchemy-solidus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlchemyCMS%2Falchemy-solidus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlchemyCMS%2Falchemy-solidus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlchemyCMS","download_url":"https://codeload.github.com/AlchemyCMS/alchemy-solidus/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248125592,"owners_count":21051770,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alchemy","cms","ecommerce","frontend","solidus"],"created_at":"2025-02-12T05:31:25.876Z","updated_at":"2025-04-09T23:15:49.647Z","avatar_url":"https://github.com/AlchemyCMS.png","language":"Ruby","readme":"[![CI](https://github.com/AlchemyCMS/alchemy-solidus/actions/workflows/ci.yml/badge.svg)](https://github.com/AlchemyCMS/alchemy-solidus/actions/workflows/ci.yml)\n[![Gem Version](https://badge.fury.io/rb/alchemy-solidus.svg)](https://badge.fury.io/rb/alchemy-solidus)\n\n# Sponsoring\n\nDevelopment and maintenance is sponsored by [Blish](https://blish.cloud/).\n\n[![BLISH Logo](https://blish.cloud/BLISH_Logo.svg)](https://blish.cloud)\n\n# Alchemy-Solidus\n\nThis is a [AlchemyCMS](https://alchemy-cms.com) and [Solidus](https://solidus.io) integration gem.\n\n1. It provides tabs in Alchemy and Solidus menus to easily switch between both backends\n2. It offers two new Essences for Alchemy called `EssenceSpreeProduct` and `EssenceSpreeTaxon` that you can use to place Spree products and/or Taxons on your pages.\n3. Shares admin sessions and user abilities between Alchemy and Solidus.\n\n## Compatibility\n\n### Solidus\n\nThis version runs with Solidus v4.0 and up.\n\n- For a Solidus 3.x compatible version please use the `6.3-stable` branch or `6.3.1` gem version.\n- For a Solidus \u003c 2.11 compatible version please use the `3.1-stable` branch or `3.3.0` gem version.\n- For a Solidus \u003c 2.6 compatible version please use the `2.3-stable` branch or `2.3.2` gem version.\n- For a Solidus 1.x compatible version please use the `1.0-stable` branch or `1.1.0` gem version.\n\n\u003e **NOTE:** If you are using Solidus v3.0 with Alchemy v5.3, make sure to also use Rails v6.0 and the legacy image attachment adapter (paperclip) and not the active storage adapter, since this needs Rails \u003e= 6.1 and Alchemy v5.3 is not Rails 6.1 compatible. You need Alchemy v6.0 for Rails \u003e= 6.1.\n\n### Alchemy\n\nThis version runs with Alchemy v7.2\n\n- For a Alchemy 7.0/7.1 compatible version please use the `7.2-stable` branch or `7.2` gem version.\n- For a Alchemy 6.x compatible version please use the `5.0-stable` branch or `5.0` gem version.\n- For a Alchemy 5.x compatible version please use the `4.1-stable` branch or `4.1` gem version.\n- For a Alchemy 4.x compatible version please use the `3.1-stable` branch or `3.3` gem version.\n- For a Alchemy 4.0 compatible version please use the `2.3-stable` branch or `2.3` gem version.\n- For a Alchemy 3.x compatible version please use the `1.0-stable` branch or `1.1` gem version.\n\n## Installation\n\nAdd this line to your applications `Gemfile`:\n\n```ruby\ngem 'alchemy-solidus', '~\u003e 7.0'\n```\n\nInstall the gem with:\n\n```bash\n$ bundle install\n```\n\n## Automated setup\n\n**Recommended**\n\nWe ship a Rails generator that helps you to install this gem into your existing application.\n\n```bash\n$ bin/rails g alchemy:solidus:install\n```\n\nThere are several options available, please check them with\n\n```bash\n$ bin/rails g alchemy:solidus:install --help\n```\n\n## Upgrading\n\nTo upgrade update the Gemfile and run the install generator again\n\n```bash\n$ bin/rails g alchemy:solidus:install\n```\n\n**NOTE** Please make sure to remove the `Alchemy::Modules.register_module` part from your `config/initializer/alchemy.rb` file if upgrading from 2.5.\n\n## Manual setup (for advanced users)\n\nFor regular setups we recommend the [automated installer](#automated-setup) mentioned above. But if you know what you are doing and want to have full control over the integration you can also set this up manually.\n\n### Authentication system installation\n\nBoth Alchemy and Solidus come without an authentication system in place. You will need to choose an authentication system yourself. There are 3 available options. Whichever you choose, you need to instruct Solidus \u0026 Alchemy about your choice of authentication system.\n\nHere are the steps for each option:\n\n#### 1. Option: Use [Solidus Auth Devise](https://github.com/solidusio/solidus_auth_devise)\n\n**Recommended for:**\n  - An existing Solidus installation (`gem 'solidus_auth_devise'` should already be in your Gemfile).\n  - You are just adding Alchemy\n\nTo use Solidus Auth Devise, instruct Alchemy to use the `Spree::User` class:\n\n```ruby\n# config/initializers/alchemy.rb\nAlchemy.user_class_name = 'Spree::User'\nAlchemy.current_user_method = :spree_current_user\n```\n\nIf you put Spree in it's own routing namespace (see below) you will want to\nlet Alchemy know these paths:\n\n```ruby\n# config/initializers/alchemy.rb\nAlchemy.login_path = '/store/login'\nAlchemy.logout_path = '/store/logout'\n```\n\n#### 2. Option: Use [Alchemy Devise](https://github.com/AlchemyCMS/alchemy-devise)\n\n**Recommended for:**\n  - An existing Alchemy installation\n  - You don't have an authentication system and don't want to role an authentication system on your own.\n\nAdd `alchemy-devise` to your `Gemfile`\n\n```ruby\n# Gemfile\ngem 'alchemy-devise', '~\u003e 4.1'\n```\n\nand install it:\n\n```bash\n$ bundle install\n$ bundle exec rails g alchemy:devise:install\n```\n\nRun the Solidus installer:\n\n*NOTE*: Skip this if you already have a running Solidus installation.\n\n```bash\n$ bundle exec rails g spree:install\n```\n\nThen run the solidus custom user generator:\n\n```bash\n$ bundle exec rails g spree:custom_user Alchemy::User\n```\n\nNow you'll need to instruct Solidus to use the Alchemy User class:\n\n```ruby\n# config/initializers/spree.rb\n...\nSpree.user_class = \"Alchemy::User\"\n...\n```\n\nand tell Solidus about Alchemy's path helpers:\n\n```ruby\n# lib/spree/authentication_helpers.rb\n    ...\n    def spree_login_path\n      Alchemy.login_path\n    end\n\n    def spree_signup_path\n      Alchemy.signup_path\n    end\n\n    def spree_logout_path\n      Alchemy.logout_path\n    end\n    ...\n```\n\n#### 3. Option: Build your own authentication\n\nPlease follow the [Solidus custom authentication](https://guides.solidus.io/developers/users/custom-authentication.html) and the [Alchemy custom authentication](https://guides.alchemy-cms.com/custom_authentication.html) guides in order to integrate your custom user with Solidus and Alchemy.\n\n### In either case\n\nInstall the migrations\n\n```bash\n$ bundle exec rake alchemy_solidus:install:migrations\n```\n\nRun the installer of Alchemy\n\n```bash\n$ bundle exec rake alchemy:install\n```\n\nand follow the on screen instructions.\n\n### Render Alchemy Content in Solidus Layout\n\n~~If you plan to render the Alchemy site in the Solidus layout add the following\nto your initializer:~~\n\n```ruby\n# config/initializers/alchemy.rb\nrequire 'alchemy/solidus/use_solidus_layout'\n```\n\n**NOTE:** Since v2.5.2 this is done automatically for you. If you upgraded from an older version you can safely remove this from your initializers.\n\n### Render Alchemy Content in Solidus views\n\n~~If you plan to render Alchemy content in your Solidus views (ie. a global header\nor footer section), you need to include the Alchemy view helpers and language\nstore in your Solidus controllers with the following addition to your\ninitializer:~~\n\n```ruby\n# config/initializers/alchemy.rb\nrequire 'alchemy/solidus/alchemy_in_solidus'\n```\n\n**NOTE:** Since v2.5.2 this is done automatically for you. If you upgraded from an older version you can safely remove this from your initializers.\n\n### Routing\n\nFor routing you have a few options.\n\n#### Place both engines in their own namespace:\n\n```ruby\n# config/routes.rb\nmount Spree::Core::Engine =\u003e '/store'\nmount Alchemy::Engine =\u003e '/pages'\n```\n\n#### Put Solidus at the root level and Alchemy in its own namespace:\n\n```ruby\n# config/routes.rb\nmount Alchemy::Engine =\u003e '/pages'\nmount Spree::Core::Engine =\u003e '/'\n```\n\n#### Put Alchemy at the root level and Solidus in its own namespace:\n\n```ruby\n# config/routes.rb\nmount Spree::Core::Engine =\u003e '/store'\nmount Alchemy::Engine =\u003e '/'\n```\n\n#### Put both engines in the root level\n\n```ruby\n# config/routes.rb\n\n# Make Alchemy's root page have higher priority than Spree's root page\nroot to: 'alchemy/pages#index'\n\nmount Spree::Core::Engine =\u003e '/'\n\n# Must be last so it's catch-all route can render undefined paths\nmount Alchemy::Engine =\u003e '/'\n```\n\n## Usage\n\nPlease make yourself familiar with AlchemyCMS by [reading the guidelines](https://guides.alchemy-cms.com)\n\n### Create a new Element for Alchemy\n\n```yaml\n# config/alchemy/elements.yml\n- name: product\n  ingredients:\n    - role: spree_product\n      type: SpreeProduct\n\n- name: product_category\n  ingredients:\n    - role: spree_taxon\n      type: SpreeTaxon\n```\n\n### Generate the views\n\n```sh\n$ rails g alchemy:elements --skip\n```\n\n### Place this element on a page layout\n\n```yaml\n# config/alchemy/page_layouts.yml\n- name: product\n  elements: [product]\n- name: products\n  elements: [product_category]\n```\n\n### Access the Solidus product or taxon in your element views\n\nYou can mix Alchemy and Solidus content in the same view.\n\n```erb\n\u003c!-- app/views/alchemy/elements/_product_view.html.erb --\u003e\n\u003c% cache element do %\u003e\n  \u003c%= element_view_for element do |el| %\u003e\n    \u003c% product = el.value(:spree_product) %\u003e\n    \u003ch1\u003e\u003c%= product.name %\u003e\u003c/h1\u003e\n    \u003cp\u003e\u003c%= product.description %\u003e\u003c/p\u003e\n    \u003c%= el.render :text %\u003e\n    \u003c%= el.render :image %\u003e\n  \u003c% end %\u003e\n\u003c% end %\u003e\n```\n\nOr for a list of taxon products\n\n```erb\n\u003c!-- app/views/alchemy/elements/_product_category_view.html.erb --\u003e\n\u003c% cache element do %\u003e\n  \u003c%= element_view_for element do |el| %\u003e\n    \u003ch2\u003e\u003c%= el.render :headline %\u003e\u003c/h2\u003e\n    \u003c%= el.render :description %\u003e\n\n    \u003c% taxon = el.value(:spree_taxon) %\u003e\n    \u003c% taxon.products.each do |product| %\u003e\n      \u003c%= link_to product.name, spree.product_path(product) %\u003e\n    \u003c% end %\u003e\n  \u003c% end %\u003e\n\u003c% end %\u003e\n```\n\nAlchemy :heart: Solidus!\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Added some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falchemycms%2Falchemy-solidus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falchemycms%2Falchemy-solidus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falchemycms%2Falchemy-solidus/lists"}