spree/spree — pull request #5343 by IrvinFan (2014-09-10 03:00:42+00:00)
Title: Always call registered extension line item comparison hooks

Steps to reproduce:

1. Install an extension that registers the line_item_comparison_hook (e.g. https://github.com/spree-contrib/spree_vouchers)
2. Add a product to cart with voucher.
3. Add the same product to cart without voucher.

Expect: two line items: one with voucher one without
Actual: one line item with voucher (quantity doubled)

Apprently the codes that match new line item (without options) fails to distinguish it from the existing line item that has options. Because this codes https://github.com/spree/spree/blob/master/core/app/models/spree/order.rb#L334-L337 will not call the hook and return true when there is no options passed in for the new item.

The fix proposed in this PR is to always call the registered hook. It's up to the extension to determine if there is a match or not.

CC @jsqu99 since this was your codes and this PR will break some of your extension like spree_vouchers