Major/new features

Rails 4 compatibility

Spree 2.1.0 is the first Spree release which is Rails 4 compatible. Go ahead, try it out!

Breaking API changes

Spree’s API component has undergone some work to make it easier to build JavaScript-backed frontends. For example, our experimental Spree+Marionette project.

As a result, we have altered some parts of the API to make this process easier. Please check the API changelog below to see if anything in there affects you.

Better Spree PayPal Express extension

We now have a better Spree PayPal Express extension which is fully compatible with this release. If you are looking for PayPal Express Checkout integration for your new Spree store, check out this extension.

API

  • The Products API endpoint now returns an additional key called shipping_category_id, and also requires shipping_category_id on create.

    Jeff Dutil

  • The Products API endpoint now returns an additional key called display_price, which is the proper rendering of the price of a product.

    Ryan Bigg

  • The Images API’s attachment_url key has been removed in favour of keys that reflect the current image styles available in the application, such as mini_url and product_url. Use these now to references images.

    Ryan Bigg

  • Fix issue where calling OrdersController#update with line item parameters would always create new line items, rather than updating existing ones.

    Ryan Bigg

  • The Orders API endpoint now returns an additional key called display_item_total, which is the proper rendering of the total line item price of an order.

    Ryan Bigg

  • Include a per_page key in Products API end response so that libraries like jQuery.simplePagination can use this to display a pagination element on the page.

    Ryan Bigg

  • Line item responses now contain single_display_amount and display_amount for “pretty” versions of the single and total amount for a line item, as well as a total node which is an “ugly” version of the total amount of a line item.

    Ryan Bigg

  • /api/orders endpoints now accept a ?order_token parameter which should be the order’s token. This can be used to authorize actions on an order without having to pass in an API key.

    Ryan Bigg

  • Requests to POST /api/line_items will now update existing line items. For example if you have a line item with a variant ID=2 and quantity=10 and you attempt to create a new line item for the same variant with a quantity of 5, the existing line item’s quantity will be updated to 15. Previously, a new line item would erroneously be created.

    Ryan Bigg

  • /api/countries now will a 304 response if no country has been changed since the last request.

    Ryan Bigg

  • The Shipments API no longer returns inventory units. Instead, it will return manifest objects. This is necessary due to the split shipments changes brought in by Spree 2.

    Ryan Bigg

  • Checkouts API’s update action will now correctly process line item attributes (either line_items or line_item_attributes)

    Ryan Bigg

  • The structure of shipments data in the API has changed. Shipments can now have many shipping methods, shipping rates (which in turn have many zones and shipping categories), as well as a new key called “manifest” which returns the list of items contained within just this shipment for the order.

    Ryan Bigg

  • Address responses now contain a full_name attribute.

    Ryan Bigg

  • Shipments responses now contain a selected_shipping_rate key, so that you don’t have to sort through the list of shipping_rates to get the selected one.

    Ryan Bigg

  • Checkouts API now correctly processes incoming payment data during the payment step.

    Ryan Bigg

  • Fix issue where set_current_order before filter would be called when CheckoutsController actions were run, causing the order object to be deleted. #3306

    Ryan Bigg

  • An order can no longer transition past the “cart” state without first having a line item. #3312

    Ryan Bigg

  • Attributes other than “quantity” and “variant_id” will be added to a line item when creating along with an order. #3404

    Alex Marles & Ryan Bigg

  • Requests to POST /api/line_items will now update existing line items. For example if you have a line item with a variant ID=2 and quantity=10 and you attempt to create a new line item for the same variant with a quantity of 5, the existing line item’s quantity will be updated to 15. Previously, a new line item would erroneously be created.

    • Ryan Bigg
  • Checkouts API’s update action will now correctly process line item attributes (either line_items or line_item_attributes)

    • Ryan Bigg
  • Taxon attributes from /api/taxons are now returned within taxons subkey. Before:

[{ name: 'Ruby' ... }]

Now:

{ taxons: [{ name: 'Ruby' }]}

* Ryan Bigg

Backend

  • layouts/admin.html.erb was broken into partials for each section. e.g. header, menu, submenu, sidebar. Extensions should update their deface overrides accordingly

    Washington Luiz

  • No longer requires all jquery ui modules. Extensions should include the ones they need on their own manifest file. #3237

    Washington Luiz

  • Symbolize attachment style keys on ImageSettingController otherwise users would get undefined method `processors’ for “48x48>”:String> since paperclip can’t handle key strings. #3069 #3080

    Washington Luiz

  • Split line items across shipments. Use this to move line items between existing shipments or to create a new shipment on an order from existing line items.

    John Dyer

  • Fixed display of “Total” price for a line item on a shipment. #3135

    John Dyer

  • Fixed issue where selecting an existing user in the customer details step would not associate them with an order.

    Ryan Bigg and dan-ding

  • We now use jQuery.payment (from Stripe) to provide slightly better formatting on credit card number, expiry and CVV fields.

    Ryan Bigg

  • “Infinite scrolling” now implemented for products taxon search to prevent loading all taxons at once. Only 50 taxons are loaded at a time now.

    Ryan Bigg

Cmd

No changes.

Core

  • Product requires shipping_category_id on create #3188.

    Jeff Dutil

  • No longer set ActiveRecord::Base.include_root_in_json = true during install. Originally set to false back in 2011 according to convention. After https://groups.google.com/forum/#!topic/spree-user/D9dZQayC4z, it was changed. Applications should now decide their own setting for this value.

    Weston Platter

  • Change order.promotion_credit_exists? api. Now it receives an adjustment originator (PromotionAction instance) instead of a promotion. Allowing multiple adjustments being created for the same promotion as the current PromotionAction / Promotion api suggests #3262

  • Remove after_save callback for stock items backorders processing and fixes count on hand updates when there are backordered units #3066

    Washington Luiz

  • InventoryUnit#backordered_for_stock_item no longer returns readonly objects neither return an ActiveRecored::Association. It returns only an array of writable backordered units for a given stock item #3066

    Washington Luiz

  • Scope shipping rates as per shipping method display_on #3119 e.g. Shipping methods set to back_end only should not be displayed on frontend too

    Washington Luiz

  • Add propagate_all_variants attribute to StockLocation. It controls whether a stock items should be created fot the stock location every time a variant or a stock location is created

    Washington Luiz

  • Add backorderable_default attribute to StockLocation. It sets the backorderable attribute of each new stock item

    Washington Luiz

  • Removed t() override in Spree::BaseHelper. #3083

    Washington Luiz

  • Improve performance of Order#payment_required? by not updating the totals every time. #3040 #3086

    Washington Luiz

  • Fixed the FlexiRate Calculator for cases when max_items is set. #3159

    Dana Jones

  • Translation for admin tabs are now located under the spree.admin.tab key. Previously, they were on the top-level, which led to conflicts when users wanted to override view translations, like this:

en:
  spree:
    orders:
      show:
        thank_you: "Thanks, buddy!"

See #3133 for more information.

* Ryan Bigg*
  • CreditCard model now validates that the card is not expired.

    Ryan Bigg

  • Payment model will now no longer provide a vague error message for when the source is invalid. Instead, it will provide error messages like “Credit Card Number can’t be blank”

    Ryan Bigg

  • Calling #destroy on any PaymentMethod, Product, TaxCategory, TaxRate or Variant object will now no longer delete that object. Instead, the deleted_at attribute on that object will be set to the current time. Attempting to find that object again using something such as Spree::Product.find(1) will fail because there is now a default scope to only find non-deleted records on these models. To remove this scope, use Spree::Product.unscoped.find(1). #3321

    Ryan Bigg

  • Removed variants_including_master_and_deleted, in favour of using the Paranoia gem. This scope would now be achieved using variants_including_master.with_deleted.

    Ryan Bigg

  • You can now find the total amount on hand of a variant by calling Variant#total_on_hand. #3427

    Ruben Ascencio

  • Tax categories are now stored on line items. This should make tax calculations slightly faster. #3481

    Ryan Bigg

  • update_attribute(s)_without_callbacks have gone away, in favour of update_column(s)

    Ryan Bigg

Frontend

  • Fix issue where “Use Billing Address” checkbox was unticked when certain browsers autocompleted the checkout form. #3068 #3085

    Washington Luiz

  • Switch to new Google Analytics analytics.js SDK from ga.js SDK for custom dimensions & metrics.

    Jeff Dutil

  • We now use jQuery.payment (from Stripe) to provide slightly better formatting on credit card number, expiry and CVV fields.

    Ryan Bigg

Spree::ActiveShipping

  • Origin address fields (e.g., origin_country) have been removed from the Spree::ActiveShipping preferences.

    Ryan Bigg