0.27
Repository is archived
No release in over 3 years
Low commit activity in last 3 years
Add wishlists to Spree
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.8.0.rc1

Runtime

>= 1.0.0
>= 1.0.0
 Project Readme

⚠️ Deprecation notice ⚠️

Since v4.4, Spree supports Wishlists out of the box - spree/spree#11308. Code is compatible with this extension and everyone can migrate easily.

Hence, this extension is flagged as deprecated and won't be developed and actively maintained anymore.

Spree Wishlist

Build Status Code Climate

The Spree Wishlist extension enables multiple wishlists per user, as well as managing those as public (sharable) and private. It also includes the ability to notify a friend via email of a recommended product.


Installation

Add the following to your Gemfile

gem 'spree_wishlist', github: 'spree-contrib/spree_wishlist', branch: 'master'

Run

bundle install
bundle exec rails g spree_wishlist:install

API endpoints

Please read Spree API v1 summary first.

Available endpoints:

Wishlists management

  • GET /api/v1/wishlists - returns a list of wishlists for signed in user

  • GET /api/v1/wishlists/:id - returns single wishlists with a list of Products (Variants)

  • POST /api/v1/wishlists - creates a new wishlist

    payload:

    wishlist: {
      "name": "fathers day"
    }
  • PATCH /api/v1/wishlists/:id

    payload:

    wishlist: {
      "name": "new name"
    }
  • DELETE /api/v1/wishlists/:id

Wishlists products management

  • POST /api/v1/wished_products - adds Product (Variant) to a Wishlist

    payload:

    wished_product: {
      "variant_id": 2,
      "wishlist_id": 1
    }
  • PATCH /api/v1/wished_products/:id

    payload:

    wished_product: {
      "variant_id": 3,
      "wishlist_id": 2
    }
  • DELETE /api/v1/wished_products/:id


Wishlists V2

Wishlists management

  • GET /api/v2/storefront/wishlists - returns a list of wishlists for signed in user

  • GET /api/v2/storefront/wishlists/:access_hash - returns single wishlists with a list of Products (Variants)

    payload:

    { "include": "wished_products.variant" }
  • PATCH /api/v2/storefront/wishlists/:access_hash

    payload:

    wishlist: {
        "name": "Wishlist name",
        "is_default": true,
        "is_private": true,
      }
  • POST /api/v2/storefront/wishlists - creates a new wishlist

    payload:

      wishlist: {
          "name": "Wishlist name",
          "is_default": true,
          "is_private": true,
        }
  • DELETE /api/v2/storefront/wishlists/:access_hash

Wishlists products management

  • POST /api/v2/storefront/wishlists/:access_hash/wished_products - adds Product (Variant) to a Wishlist

    payload:

    wished_product: {
      "variant_id": 2,
      "remark": "I want this",
      "quantity": 3
    }
  • PATCH /api/v2/storefront/wishlists/:access_hash/wished_products/:id

    payload:

    wished_product: {
      "variant_id": 2,
      "remark": "I want this",
      "quantity": 4
    }
  • DELETE /api/v2/storefront/wishlists/:access_hash/wished_products/:id


Contributing

See corresponding guidelines


Copyright (c) 2009-2020 Spree Commerce Inc. and contributors, released under the New BSD License