Spree Store Pickup
This is a Store Pickup extension for Spree Commerce, an open source e-commerce platform built with Ruby on Rails. Adds in-store pickup as selectable shipping and payment method during checkout.
Installation
-
Add this extension to your Gemfile with this line:
bundle add spree_store_pickup
-
Run the install generator
bundle exec rails g spree_store_pickup:install -
Restart your server
If your server was running, restart it so that it can find the assets properly.
Usage
-
Create (or enable) a Shipping Method that represents in‑store pickup. The generator creates a shipping method with a
store_pickuptype. Ensure the shipping method you want to use returnstrueforstore_pickup?. -
Create a Payment Method for store pickup (e.g. name: "Pay In Store") whose
method_typeisstore_pickup. -
The gem decorates
Spree::PaymentMethod#available_for_order?with these rules:- The store pickup payment method is shown only when the selected shipping method is store pickup.
- When store pickup shipping is selected, all other available payment methods are shown too.
-
To show ONLY the store pickup payment method when store pickup shipping is selected, enable this in an initializer:
SpreeStorePickup::Config[:exclusive_payment_method] = true
-
For custom rules, prepend your own decorator in the host app. Use a different module name than the gem's
Spree::PaymentMethodStorePickupDecoratorso it doesn't replace it. Callsuperto keep the gem's rules, or skip it to replace them:
module Spree
module PaymentMethodCodDecorator
def available_for_order?(order)
return false unless super
# Example: hide a COD payment method when store pickup shipping is selected.
return false if store_pickup_available?(order) && respond_to?(:cod_payment?) && cod_payment?
true
end
end
PaymentMethod.prepend PaymentMethodCodDecorator
endHelpers available on every payment method:
payment_method.store_pickup?-
payment_method.store_pickup_available?(order)(true when the order's selected shipping method is store pickup)
Developing
-
Create a dummy app
bundle update bundle exec rake test_app -
Add your new code
-
Run tests
bundle exec rspec
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_store_pickup/factories'Releasing a new version
bundle exec gem bump -p -t
bundle exec gem releaseFor more options please see gem-release README
Contributing
If you'd like to contribute, please take a look at the instructions for installing dependencies and crafting a good pull request.
Copyright (c) 2026 OlympusOne, released under the MIT License.