{"action":"closed","issue":{"url":"https://api.github.com/repos/potteryhouse/stock_by_attribute_1.5.4/issues/42","labels_url":"https://api.github.com/repos/potteryhouse/stock_by_attribute_1.5.4/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/potteryhouse/stock_by_attribute_1.5.4/issues/42/comments","events_url":"https://api.github.com/repos/potteryhouse/stock_by_attribute_1.5.4/issues/42/events","html_url":"https://github.com/potteryhouse/stock_by_attribute_1.5.4/issues/42","id":114312222,"number":42,"title":"incorrect display order of DD attributes","user":{"login":"mc12345678","id":2072812,"avatar_url":"https://avatars.githubusercontent.com/u/2072812?v=3","gravatar_id":"","url":"https://api.github.com/users/mc12345678","html_url":"https://github.com/mc12345678","followers_url":"https://api.github.com/users/mc12345678/followers","following_url":"https://api.github.com/users/mc12345678/following{/other_user}","gists_url":"https://api.github.com/users/mc12345678/gists{/gist_id}","starred_url":"https://api.github.com/users/mc12345678/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mc12345678/subscriptions","organizations_url":"https://api.github.com/users/mc12345678/orgs","repos_url":"https://api.github.com/users/mc12345678/repos","events_url":"https://api.github.com/users/mc12345678/events{/privacy}","received_events_url":"https://api.github.com/users/mc12345678/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/potteryhouse/stock_by_attribute_1.5.4/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-30T17:02:44Z","updated_at":"2015-11-17T21:46:32Z","closed_at":"2015-11-17T21:46:32Z","body":"Identified by @mattys in the ZC forum at one of the many SBA threads:\r\nThe display of option values is not in the order generated by the Dynamic Dropdown code which is based on the sort order set in the attributes controller.\r\n\r\nDirect Cause: \"Key\" (option_value_id) of the object is numeric and most browsers will \"sort\" the object based on that number. \r\nRelated Cause: the sequence of the attributes is not held constant by the code, but instead incorrectly treated as if will be correctly sequenced by the \"recipient\" of the data.\r\n\r\nPotential Temporary fix: Change the key to a string without effecting the add-to-cart process by attaching a single character (minimize additional data to be sent) to the key so that it will consistently be treated as a string.  (This is not fully tested, but may at least work properly on 50% of the browsers.)\r\nLong term fix (correct fix and not a \"patch\".  Recommend opening a new item after temporary fix is complete or invalidated): implement a coded method that will maintain the \"sort\" order.  Two methods come to mind, 1) a simple array that is itself in a sequence associating the position in the array as the order and the value at that position as the option_value_id associated or 2) a javascript storage/operations structure that will maintain the data and the order.  Both of these are well documented in stackoverflow.  "}}