{"action":"closed","number":10977,"pull_request":{"url":"https://api.github.com/repos/woothemes/woocommerce/pulls/10977","id":71142254,"html_url":"https://github.com/woothemes/woocommerce/pull/10977","diff_url":"https://github.com/woothemes/woocommerce/pull/10977.diff","patch_url":"https://github.com/woothemes/woocommerce/pull/10977.patch","issue_url":"https://api.github.com/repos/woothemes/woocommerce/issues/10977","number":10977,"state":"closed","locked":false,"title":"Allow string indexes for shipping packages","user":{"login":"thenbrent","id":235523,"avatar_url":"https://avatars.githubusercontent.com/u/235523?v=3","gravatar_id":"","url":"https://api.github.com/users/thenbrent","html_url":"https://github.com/thenbrent","followers_url":"https://api.github.com/users/thenbrent/followers","following_url":"https://api.github.com/users/thenbrent/following{/other_user}","gists_url":"https://api.github.com/users/thenbrent/gists{/gist_id}","starred_url":"https://api.github.com/users/thenbrent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thenbrent/subscriptions","organizations_url":"https://api.github.com/users/thenbrent/orgs","repos_url":"https://api.github.com/users/thenbrent/repos","events_url":"https://api.github.com/users/thenbrent/events{/privacy}","received_events_url":"https://api.github.com/users/thenbrent/received_events","type":"User","site_admin":false},"body":"At the moment WC is (I think unintentionally) enforcing shipping package indexes to be integers.\r\n\r\nThis is because the JavaScript used in the cart/checkout ajax which grabs the shipping methods uses an array to store the values, rather than an object, and JavaScript arrays can not have string indexes.\r\n\r\nThis patch changes the `shipping_methods` object type to be an array.\r\n\r\nThe reason string keys are handy is because with Subscriptions, we sometimes need to allow customers to choose recurring shipping method/s as well as shipping method/s on the initial order (e.g. https://cloudup.com/cW_EhXtJBzR). Because WC allows for multiple different packages, we also need to account for that and need to prefix our shipping methods with something unique enough that having multiple packages won't conflict with it. A string key for that helps a lot. ","created_at":"2016-05-24T00:40:47Z","updated_at":"2016-05-24T11:30:06Z","closed_at":"2016-05-24T11:30:05Z","merged_at":"2016-05-24T11:30:05Z","merge_commit_sha":"6e0f26cef1f514a6d475b982425c21bac931e886","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/woothemes/woocommerce/pulls/10977/commits","review_comments_url":"https://api.github.com/repos/woothemes/woocommerce/pulls/10977/comments","review_comment_url":"https://api.github.com/repos/woothemes/woocommerce/pulls/comments{/number}","comments_url":"https://api.github.com/repos/woothemes/woocommerce/issues/10977/comments","statuses_url":"https://api.github.com/repos/woothemes/woocommerce/statuses/aa2b97cb4c4928daf789a24717d12bfaf0014177","head":{"label":"thenbrent:allow_string_package_index","ref":"allow_string_package_index","sha":"aa2b97cb4c4928daf789a24717d12bfaf0014177","user":{"login":"thenbrent","id":235523,"avatar_url":"https://avatars.githubusercontent.com/u/235523?v=3","gravatar_id":"","url":"https://api.github.com/users/thenbrent","html_url":"https://github.com/thenbrent","followers_url":"https://api.github.com/users/thenbrent/followers","following_url":"https://api.github.com/users/thenbrent/following{/other_user}","gists_url":"https://api.github.com/users/thenbrent/gists{/gist_id}","starred_url":"https://api.github.com/users/thenbrent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thenbrent/subscriptions","organizations_url":"https://api.github.com/users/thenbrent/orgs","repos_url":"https://api.github.com/users/thenbrent/repos","events_url":"https://api.github.com/users/thenbrent/events{/privacy}","received_events_url":"https://api.github.com/users/thenbrent/received_events","type":"User","site_admin":false},"repo":{"id":6118453,"name":"woocommerce","full_name":"thenbrent/woocommerce","owner":{"login":"thenbrent","id":235523,"avatar_url":"https://avatars.githubusercontent.com/u/235523?v=3","gravatar_id":"","url":"https://api.github.com/users/thenbrent","html_url":"https://github.com/thenbrent","followers_url":"https://api.github.com/users/thenbrent/followers","following_url":"https://api.github.com/users/thenbrent/following{/other_user}","gists_url":"https://api.github.com/users/thenbrent/gists{/gist_id}","starred_url":"https://api.github.com/users/thenbrent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thenbrent/subscriptions","organizations_url":"https://api.github.com/users/thenbrent/orgs","repos_url":"https://api.github.com/users/thenbrent/repos","events_url":"https://api.github.com/users/thenbrent/events{/privacy}","received_events_url":"https://api.github.com/users/thenbrent/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/thenbrent/woocommerce","description":"An open source eCommerce plugin for WordPress created by WooThemes.","fork":true,"url":"https://api.github.com/repos/thenbrent/woocommerce","forks_url":"https://api.github.com/repos/thenbrent/woocommerce/forks","keys_url":"https://api.github.com/repos/thenbrent/woocommerce/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thenbrent/woocommerce/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thenbrent/woocommerce/teams","hooks_url":"https://api.github.com/repos/thenbrent/woocommerce/hooks","issue_events_url":"https://api.github.com/repos/thenbrent/woocommerce/issues/events{/number}","events_url":"https://api.github.com/repos/thenbrent/woocommerce/events","assignees_url":"https://api.github.com/repos/thenbrent/woocommerce/assignees{/user}","branches_url":"https://api.github.com/repos/thenbrent/woocommerce/branches{/branch}","tags_url":"https://api.github.com/repos/thenbrent/woocommerce/tags","blobs_url":"https://api.github.com/repos/thenbrent/woocommerce/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thenbrent/woocommerce/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thenbrent/woocommerce/git/refs{/sha}","trees_url":"https://api.github.com/repos/thenbrent/woocommerce/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thenbrent/woocommerce/statuses/{sha}","languages_url":"https://api.github.com/repos/thenbrent/woocommerce/languages","stargazers_url":"https://api.github.com/repos/thenbrent/woocommerce/stargazers","contributors_url":"https://api.github.com/repos/thenbrent/woocommerce/contributors","subscribers_url":"https://api.github.com/repos/thenbrent/woocommerce/subscribers","subscription_url":"https://api.github.com/repos/thenbrent/woocommerce/subscription","commits_url":"https://api.github.com/repos/thenbrent/woocommerce/commits{/sha}","git_commits_url":"https://api.github.com/repos/thenbrent/woocommerce/git/commits{/sha}","comments_url":"https://api.github.com/repos/thenbrent/woocommerce/comments{/number}","issue_comment_url":"https://api.github.com/repos/thenbrent/woocommerce/issues/comments{/number}","contents_url":"https://api.github.com/repos/thenbrent/woocommerce/contents/{+path}","compare_url":"https://api.github.com/repos/thenbrent/woocommerce/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thenbrent/woocommerce/merges","archive_url":"https://api.github.com/repos/thenbrent/woocommerce/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thenbrent/woocommerce/downloads","issues_url":"https://api.github.com/repos/thenbrent/woocommerce/issues{/number}","pulls_url":"https://api.github.com/repos/thenbrent/woocommerce/pulls{/number}","milestones_url":"https://api.github.com/repos/thenbrent/woocommerce/milestones{/number}","notifications_url":"https://api.github.com/repos/thenbrent/woocommerce/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thenbrent/woocommerce/labels{/name}","releases_url":"https://api.github.com/repos/thenbrent/woocommerce/releases{/id}","deployments_url":"https://api.github.com/repos/thenbrent/woocommerce/deployments","created_at":"2012-10-08T02:01:21Z","updated_at":"2015-03-05T23:52:58Z","pushed_at":"2016-05-24T00:35:00Z","git_url":"git://github.com/thenbrent/woocommerce.git","ssh_url":"git@github.com:thenbrent/woocommerce.git","clone_url":"https://github.com/thenbrent/woocommerce.git","svn_url":"https://github.com/thenbrent/woocommerce","homepage":"http://www.woothemes.com/woocommerce/","size":100216,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"woothemes:master","ref":"master","sha":"7645558131199c63b4168ad014e3078e2d951fc6","user":{"login":"woothemes","id":473596,"avatar_url":"https://avatars.githubusercontent.com/u/473596?v=3","gravatar_id":"","url":"https://api.github.com/users/woothemes","html_url":"https://github.com/woothemes","followers_url":"https://api.github.com/users/woothemes/followers","following_url":"https://api.github.com/users/woothemes/following{/other_user}","gists_url":"https://api.github.com/users/woothemes/gists{/gist_id}","starred_url":"https://api.github.com/users/woothemes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/woothemes/subscriptions","organizations_url":"https://api.github.com/users/woothemes/orgs","repos_url":"https://api.github.com/users/woothemes/repos","events_url":"https://api.github.com/users/woothemes/events{/privacy}","received_events_url":"https://api.github.com/users/woothemes/received_events","type":"Organization","site_admin":false},"repo":{"id":2179920,"name":"woocommerce","full_name":"woothemes/woocommerce","owner":{"login":"woothemes","id":473596,"avatar_url":"https://avatars.githubusercontent.com/u/473596?v=3","gravatar_id":"","url":"https://api.github.com/users/woothemes","html_url":"https://github.com/woothemes","followers_url":"https://api.github.com/users/woothemes/followers","following_url":"https://api.github.com/users/woothemes/following{/other_user}","gists_url":"https://api.github.com/users/woothemes/gists{/gist_id}","starred_url":"https://api.github.com/users/woothemes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/woothemes/subscriptions","organizations_url":"https://api.github.com/users/woothemes/orgs","repos_url":"https://api.github.com/users/woothemes/repos","events_url":"https://api.github.com/users/woothemes/events{/privacy}","received_events_url":"https://api.github.com/users/woothemes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/woothemes/woocommerce","description":"An open source eCommerce plugin for WordPress created by WooThemes.","fork":false,"url":"https://api.github.com/repos/woothemes/woocommerce","forks_url":"https://api.github.com/repos/woothemes/woocommerce/forks","keys_url":"https://api.github.com/repos/woothemes/woocommerce/keys{/key_id}","collaborators_url":"https://api.github.com/repos/woothemes/woocommerce/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/woothemes/woocommerce/teams","hooks_url":"https://api.github.com/repos/woothemes/woocommerce/hooks","issue_events_url":"https://api.github.com/repos/woothemes/woocommerce/issues/events{/number}","events_url":"https://api.github.com/repos/woothemes/woocommerce/events","assignees_url":"https://api.github.com/repos/woothemes/woocommerce/assignees{/user}","branches_url":"https://api.github.com/repos/woothemes/woocommerce/branches{/branch}","tags_url":"https://api.github.com/repos/woothemes/woocommerce/tags","blobs_url":"https://api.github.com/repos/woothemes/woocommerce/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/woothemes/woocommerce/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/woothemes/woocommerce/git/refs{/sha}","trees_url":"https://api.github.com/repos/woothemes/woocommerce/git/trees{/sha}","statuses_url":"https://api.github.com/repos/woothemes/woocommerce/statuses/{sha}","languages_url":"https://api.github.com/repos/woothemes/woocommerce/languages","stargazers_url":"https://api.github.com/repos/woothemes/woocommerce/stargazers","contributors_url":"https://api.github.com/repos/woothemes/woocommerce/contributors","subscribers_url":"https://api.github.com/repos/woothemes/woocommerce/subscribers","subscription_url":"https://api.github.com/repos/woothemes/woocommerce/subscription","commits_url":"https://api.github.com/repos/woothemes/woocommerce/commits{/sha}","git_commits_url":"https://api.github.com/repos/woothemes/woocommerce/git/commits{/sha}","comments_url":"https://api.github.com/repos/woothemes/woocommerce/comments{/number}","issue_comment_url":"https://api.github.com/repos/woothemes/woocommerce/issues/comments{/number}","contents_url":"https://api.github.com/repos/woothemes/woocommerce/contents/{+path}","compare_url":"https://api.github.com/repos/woothemes/woocommerce/compare/{base}...{head}","merges_url":"https://api.github.com/repos/woothemes/woocommerce/merges","archive_url":"https://api.github.com/repos/woothemes/woocommerce/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/woothemes/woocommerce/downloads","issues_url":"https://api.github.com/repos/woothemes/woocommerce/issues{/number}","pulls_url":"https://api.github.com/repos/woothemes/woocommerce/pulls{/number}","milestones_url":"https://api.github.com/repos/woothemes/woocommerce/milestones{/number}","notifications_url":"https://api.github.com/repos/woothemes/woocommerce/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/woothemes/woocommerce/labels{/name}","releases_url":"https://api.github.com/repos/woothemes/woocommerce/releases{/id}","deployments_url":"https://api.github.com/repos/woothemes/woocommerce/deployments","created_at":"2011-08-09T15:12:11Z","updated_at":"2016-05-23T23:14:15Z","pushed_at":"2016-05-24T11:30:05Z","git_url":"git://github.com/woothemes/woocommerce.git","ssh_url":"git@github.com:woothemes/woocommerce.git","clone_url":"https://github.com/woothemes/woocommerce.git","svn_url":"https://github.com/woothemes/woocommerce","homepage":"http://www.woothemes.com/woocommerce/","size":128038,"stargazers_count":2710,"watchers_count":2710,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2202,"mirror_url":null,"open_issues_count":40,"forks":2202,"open_issues":40,"watchers":2710,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/woothemes/woocommerce/pulls/10977"},"html":{"href":"https://github.com/woothemes/woocommerce/pull/10977"},"issue":{"href":"https://api.github.com/repos/woothemes/woocommerce/issues/10977"},"comments":{"href":"https://api.github.com/repos/woothemes/woocommerce/issues/10977/comments"},"review_comments":{"href":"https://api.github.com/repos/woothemes/woocommerce/pulls/10977/comments"},"review_comment":{"href":"https://api.github.com/repos/woothemes/woocommerce/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/woothemes/woocommerce/pulls/10977/commits"},"statuses":{"href":"https://api.github.com/repos/woothemes/woocommerce/statuses/aa2b97cb4c4928daf789a24717d12bfaf0014177"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"mikejolley","id":90977,"avatar_url":"https://avatars.githubusercontent.com/u/90977?v=3","gravatar_id":"","url":"https://api.github.com/users/mikejolley","html_url":"https://github.com/mikejolley","followers_url":"https://api.github.com/users/mikejolley/followers","following_url":"https://api.github.com/users/mikejolley/following{/other_user}","gists_url":"https://api.github.com/users/mikejolley/gists{/gist_id}","starred_url":"https://api.github.com/users/mikejolley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikejolley/subscriptions","organizations_url":"https://api.github.com/users/mikejolley/orgs","repos_url":"https://api.github.com/users/mikejolley/repos","events_url":"https://api.github.com/users/mikejolley/events{/privacy}","received_events_url":"https://api.github.com/users/mikejolley/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"commits":1,"additions":2,"deletions":2,"changed_files":2}}
{"actor":{"display_login":"mikejolley"}}