spree/spree — pull request #2389 by braincomb (2013-01-06 13:46:34+00:00)
Title: Prototype properties ordering behavior and select fix.

Hi all,

This is more or less two issues (behavior+fix) in one which I believe are related.

Firstly, there is a bug in product properties when selecting a prototype. It will only populate the last field and the rest of the fields will be blank. We just needed to change :last to :first selector.

Secondly, when creating a new prototype and populating them with properties, then updating (saving), the order in which they were added will be lost and they will be ordered by name. IMHO, this defeats the purpose of prototype properties, as most people will want to have them in a particular order as they were added, especially if there are many of them. So I removed the name order for properties, and also added some sorting logic to select.js.erb so that they are properly populated in the correct order.

I am not sure if this is an elegant fix, but it has been working perfectly for me, and I believe makes it more consistent in behavior.

Looking forward to feedback on this.

Thanks!