0.0
No commit activity in last 3 years
No release in over 3 years
Flexible price for spree
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Project Readme

Spree Price

Heavily inspired by spree-contrib/spree_price_book.

  1. Support multiple store price

  2. Support multiple type of prices (e.g. sales price, marked price, manufacturer's suggested retail price

  3. Support price book. Price book can be prioritized at store.

  4. Auto adjust prices according to exchange rate.

  5. Price is found by the following order.

    • Manual set price
    • Price book with higher priority in the same store
    • First price matching the currency and price type
    • First price matching the currency TODO: Find the price from parent price type without sacrificing the performance too much
  6. The price will not be populated from parent price type by default. You can either fill nil prices from parent price book with adjustment factor or refresh all prices from parent price book in admin panel.

  7. Line item and order will save all prices for each price type.

Usage

Create your own price type Price Type

Create your own price book for each currency, price type, store, user roles Price Book

You can update the prices in price book from parent price book, either filling nil prices from parent price book with adjustment factor or refreshing all prices in price book. Price Book

Update the price from product page with store, price type and role filter. If the price is not set manually, it will show you the reference price. Variant Prices

Installation

Add spree_price_books to your Gemfile:

gem 'spree_price', github: 'EONIQ/spree_price'

Bundle your dependencies and run the installation generator:

bundle
bundle exec rails g spree_price:install

Configuration

Once installed you can seed default currency exchange rates via open exchange rate

Get your app id from https://openexchangerates.org/signup

Add open_exchange_rate.rb to config/initializers

Rails.application.config.openExchangeRate = {
  appId: 'YOUR APP ID HERE',
}
bundle exec rake spree_price:currency_rates

Testing

TODO: Need to work on rspec

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.

On the first run you may need to create the Postgresql role (ex. createuser -d postgres)

bundle
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:

require 'spree_price/factories'

Credit

spree/spree spree-contrib/spree_price_book

Copyright (c) 2018 EONIQ (HK) LIMITED, released under the New BSD License