{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/woocommerce-services/pulls/comments/183183025","pull_request_review_id":114143243,"id":183183025,"diff_hunk":"@@ -349,35 +349,66 @@ public function calculate_shipping( $package = array() ) {\n \t\t\t\t$packaging_lookup = $this->service_settings_store->get_package_lookup();\n \n \t\t\t\tforeach ( (array) $instance->rates as $rate_idx => $rate ) {\n-\t\t\t\t\t$package_names = array();\n-\t\t\t\t\t$service_ids   = array();\n+\t\t\t\t\t$package_summaries = array();\n+\t\t\t\t\t$service_ids       = array();\n+\n+\t\t\t\t\t$dimension_unit      = get_option( 'woocommerce_dimension_unit' );\n+\t\t\t\t\t$weight_unit         = get_option( 'woocommerce_weight_unit' );\n+\t\t\t\t\t$measurements_format = '%s x %s x %s ' . $dimension_unit . ', %s ' . $weight_unit;\n \n \t\t\t\t\tforeach ( $rate->packages as $rate_package ) {\n-\t\t\t\t\t\t$package_format = '';\n-\t\t\t\t\t\t$items          = array();\n \t\t\t\t\t\t$service_ids[]  = $rate_package->service_id;\n \n+\t\t\t\t\t\t$item_product_ids = array();\n \t\t\t\t\t\tforeach ( $rate_package->items as $package_item ) {\n+\t\t\t\t\t\t\t$item_product_ids[] = $package_item->product_id;\n+\t\t\t\t\t\t}\n+\n+\t\t\t\t\t\t$product_summaries = array();\n+\t\t\t\t\t\t$product_counts = array_count_values( $item_product_ids );\n+\t\t\t\t\t\tforeach ( $product_counts as $product_id => $count ) {\n \t\t\t\t\t\t\t/** @var WC_Product $product */\n-\t\t\t\t\t\t\t$product = $this->lookup_product( $package, $package_item->product_id );\n+\t\t\t\t\t\t\t$product = $this->lookup_product( $package, $product_id );\n \t\t\t\t\t\t\tif ( $product ) {\n-\t\t\t\t\t\t\t\t$items[] = WC_Connect_Compatibility::instance()->get_product_name( $product );\n+\t\t\t\t\t\t\t\t$item_name = WC_Connect_Compatibility::instance()->get_product_name( $product );\n+\t\t\t\t\t\t\t\t$item_measurements = sprintf(\n+\t\t\t\t\t\t\t\t\t$measurements_format,\n+\t\t\t\t\t\t\t\t\t$package_item->length,","path":"classes/class-wc-connect-shipping-method.php","position":34,"original_position":34,"commit_id":"17b905d525804b61e6fa5ce29d78047653563692","original_commit_id":"17b905d525804b61e6fa5ce29d78047653563692","user":{"login":"dechov","id":1867547,"avatar_url":"https://avatars1.githubusercontent.com/u/1867547?v=4","gravatar_id":"","url":"https://api.github.com/users/dechov","html_url":"https://github.com/dechov","followers_url":"https://api.github.com/users/dechov/followers","following_url":"https://api.github.com/users/dechov/following{/other_user}","gists_url":"https://api.github.com/users/dechov/gists{/gist_id}","starred_url":"https://api.github.com/users/dechov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dechov/subscriptions","organizations_url":"https://api.github.com/users/dechov/orgs","repos_url":"https://api.github.com/users/dechov/repos","events_url":"https://api.github.com/users/dechov/events{/privacy}","received_events_url":"https://api.github.com/users/dechov/received_events","type":"User","site_admin":false},"body":"This causes a bug where the wrong measurements show up for the product. `$package_item` is left over from the previous loop and shouldn't be used here.","created_at":"2018-04-20T22:34:08Z","updated_at":"2018-04-20T22:34:09Z","html_url":"https://github.com/Automattic/woocommerce-services/pull/1318#discussion_r183183025","pull_request_url":"https://api.github.com/repos/Automattic/woocommerce-services/pulls/1318","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Automattic/woocommerce-services/pulls/comments/183183025"},"html":{"href":"https://github.com/Automattic/woocommerce-services/pull/1318#discussion_r183183025"},"pull_request":{"href":"https://api.github.com/repos/Automattic/woocommerce-services/pulls/1318"}}},"pull_request":{"url":"https://api.github.com/repos/Automattic/woocommerce-services/pulls/1318","id":172360860,"html_url":"https://github.com/Automattic/woocommerce-services/pull/1318","diff_url":"https://github.com/Automattic/woocommerce-services/pull/1318.diff","patch_url":"https://github.com/Automattic/woocommerce-services/pull/1318.patch","issue_url":"https://api.github.com/repos/Automattic/woocommerce-services/issues/1318","number":1318,"state":"open","locked":false,"title":"Add package and product measurements to shipping rate debug messages","user":{"login":"dechov","id":1867547,"avatar_url":"https://avatars1.githubusercontent.com/u/1867547?v=4","gravatar_id":"","url":"https://api.github.com/users/dechov","html_url":"https://github.com/dechov","followers_url":"https://api.github.com/users/dechov/followers","following_url":"https://api.github.com/users/dechov/following{/other_user}","gists_url":"https://api.github.com/users/dechov/gists{/gist_id}","starred_url":"https://api.github.com/users/dechov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dechov/subscriptions","organizations_url":"https://api.github.com/users/dechov/orgs","repos_url":"https://api.github.com/users/dechov/repos","events_url":"https://api.github.com/users/dechov/events{/privacy}","received_events_url":"https://api.github.com/users/dechov/received_events","type":"User","site_admin":false},"body":"_Edit:_ **Not to release before release of server-side fix for measurement unit issue described below.**\r\n\r\nFixes https://github.com/Automattic/woocommerce-services/issues/1163#issuecomment-368528627\r\n\r\nEnhances shipping rate front-end debug messages by adding dimensions and weight for packages and their products, and offsetting the added verbosity with some visual structure:\r\n\r\n<img width=\"805\" alt=\"screen shot 2018-03-01 at 5 40 16 pm\" src=\"https://user-images.githubusercontent.com/1867547/36873833-b4555c16-1d77-11e8-9a18-6a82b0431de2.png\">","created_at":"2018-03-01T21:38:28Z","updated_at":"2018-04-20T22:34:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4a63aacdfc07ab007fbc54218b84a820b85fd767","assignee":null,"assignees":[],"requested_reviewers":[{"login":"jeffstieler","id":63922,"avatar_url":"https://avatars3.githubusercontent.com/u/63922?v=4","gravatar_id":"","url":"https://api.github.com/users/jeffstieler","html_url":"https://github.com/jeffstieler","followers_url":"https://api.github.com/users/jeffstieler/followers","following_url":"https://api.github.com/users/jeffstieler/following{/other_user}","gists_url":"https://api.github.com/users/jeffstieler/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffstieler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffstieler/subscriptions","organizations_url":"https://api.github.com/users/jeffstieler/orgs","repos_url":"https://api.github.com/users/jeffstieler/repos","events_url":"https://api.github.com/users/jeffstieler/events{/privacy}","received_events_url":"https://api.github.com/users/jeffstieler/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":322224212,"url":"https://api.github.com/repos/Automattic/woocommerce-services/labels/[Status]%20Needs%20Review","name":"[Status] Needs Review","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Automattic/woocommerce-services/pulls/1318/commits","review_comments_url":"https://api.github.com/repos/Automattic/woocommerce-services/pulls/1318/comments","review_comment_url":"https://api.github.com/repos/Automattic/woocommerce-services/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Automattic/woocommerce-services/issues/1318/comments","statuses_url":"https://api.github.com/repos/Automattic/woocommerce-services/statuses/17b905d525804b61e6fa5ce29d78047653563692","head":{"label":"Automattic:add/shipping-debug-package-and-item-measurements","ref":"add/shipping-debug-package-and-item-measurements","sha":"17b905d525804b61e6fa5ce29d78047653563692","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":50946955,"name":"woocommerce-services","full_name":"Automattic/woocommerce-services","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/woocommerce-services","description":"WooCommerce Services is a feature plugin that integrates hosted services into WooCommerce (3.0+), and currently includes real time USPS and Canada Post shipping rates and the ability to purchase and print USPS shipping labels.","fork":false,"url":"https://api.github.com/repos/Automattic/woocommerce-services","forks_url":"https://api.github.com/repos/Automattic/woocommerce-services/forks","keys_url":"https://api.github.com/repos/Automattic/woocommerce-services/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/woocommerce-services/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/woocommerce-services/teams","hooks_url":"https://api.github.com/repos/Automattic/woocommerce-services/hooks","issue_events_url":"https://api.github.com/repos/Automattic/woocommerce-services/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/woocommerce-services/events","assignees_url":"https://api.github.com/repos/Automattic/woocommerce-services/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/woocommerce-services/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/woocommerce-services/tags","blobs_url":"https://api.github.com/repos/Automattic/woocommerce-services/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/woocommerce-services/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/woocommerce-services/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/woocommerce-services/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/woocommerce-services/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/woocommerce-services/languages","stargazers_url":"https://api.github.com/repos/Automattic/woocommerce-services/stargazers","contributors_url":"https://api.github.com/repos/Automattic/woocommerce-services/contributors","subscribers_url":"https://api.github.com/repos/Automattic/woocommerce-services/subscribers","subscription_url":"https://api.github.com/repos/Automattic/woocommerce-services/subscription","commits_url":"https://api.github.com/repos/Automattic/woocommerce-services/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/woocommerce-services/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/woocommerce-services/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/woocommerce-services/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/woocommerce-services/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/woocommerce-services/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/woocommerce-services/merges","archive_url":"https://api.github.com/repos/Automattic/woocommerce-services/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/woocommerce-services/downloads","issues_url":"https://api.github.com/repos/Automattic/woocommerce-services/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/woocommerce-services/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/woocommerce-services/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/woocommerce-services/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/woocommerce-services/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/woocommerce-services/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/woocommerce-services/deployments","created_at":"2016-02-02T19:44:26Z","updated_at":"2018-04-16T10:32:39Z","pushed_at":"2018-04-20T15:13:11Z","git_url":"git://github.com/Automattic/woocommerce-services.git","ssh_url":"git@github.com:Automattic/woocommerce-services.git","clone_url":"https://github.com/Automattic/woocommerce-services.git","svn_url":"https://github.com/Automattic/woocommerce-services","homepage":"","size":6247,"stargazers_count":57,"watchers_count":57,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"archived":false,"open_issues_count":179,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":11,"open_issues":179,"watchers":57,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"ed893cc72acbe7096cc31da857b4243e6f7bca03","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":50946955,"name":"woocommerce-services","full_name":"Automattic/woocommerce-services","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/woocommerce-services","description":"WooCommerce Services is a feature plugin that integrates hosted services into WooCommerce (3.0+), and currently includes real time USPS and Canada Post shipping rates and the ability to purchase and print USPS shipping labels.","fork":false,"url":"https://api.github.com/repos/Automattic/woocommerce-services","forks_url":"https://api.github.com/repos/Automattic/woocommerce-services/forks","keys_url":"https://api.github.com/repos/Automattic/woocommerce-services/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/woocommerce-services/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/woocommerce-services/teams","hooks_url":"https://api.github.com/repos/Automattic/woocommerce-services/hooks","issue_events_url":"https://api.github.com/repos/Automattic/woocommerce-services/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/woocommerce-services/events","assignees_url":"https://api.github.com/repos/Automattic/woocommerce-services/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/woocommerce-services/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/woocommerce-services/tags","blobs_url":"https://api.github.com/repos/Automattic/woocommerce-services/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/woocommerce-services/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/woocommerce-services/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/woocommerce-services/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/woocommerce-services/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/woocommerce-services/languages","stargazers_url":"https://api.github.com/repos/Automattic/woocommerce-services/stargazers","contributors_url":"https://api.github.com/repos/Automattic/woocommerce-services/contributors","subscribers_url":"https://api.github.com/repos/Automattic/woocommerce-services/subscribers","subscription_url":"https://api.github.com/repos/Automattic/woocommerce-services/subscription","commits_url":"https://api.github.com/repos/Automattic/woocommerce-services/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/woocommerce-services/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/woocommerce-services/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/woocommerce-services/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/woocommerce-services/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/woocommerce-services/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/woocommerce-services/merges","archive_url":"https://api.github.com/repos/Automattic/woocommerce-services/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/woocommerce-services/downloads","issues_url":"https://api.github.com/repos/Automattic/woocommerce-services/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/woocommerce-services/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/woocommerce-services/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/woocommerce-services/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/woocommerce-services/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/woocommerce-services/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/woocommerce-services/deployments","created_at":"2016-02-02T19:44:26Z","updated_at":"2018-04-16T10:32:39Z","pushed_at":"2018-04-20T15:13:11Z","git_url":"git://github.com/Automattic/woocommerce-services.git","ssh_url":"git@github.com:Automattic/woocommerce-services.git","clone_url":"https://github.com/Automattic/woocommerce-services.git","svn_url":"https://github.com/Automattic/woocommerce-services","homepage":"","size":6247,"stargazers_count":57,"watchers_count":57,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"archived":false,"open_issues_count":179,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":11,"open_issues":179,"watchers":57,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/woocommerce-services/pulls/1318"},"html":{"href":"https://github.com/Automattic/woocommerce-services/pull/1318"},"issue":{"href":"https://api.github.com/repos/Automattic/woocommerce-services/issues/1318"},"comments":{"href":"https://api.github.com/repos/Automattic/woocommerce-services/issues/1318/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/woocommerce-services/pulls/1318/comments"},"review_comment":{"href":"https://api.github.com/repos/Automattic/woocommerce-services/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Automattic/woocommerce-services/pulls/1318/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/woocommerce-services/statuses/17b905d525804b61e6fa5ce29d78047653563692"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"dechov"}}