{"action":"created","comment":{"url":"https://api.github.com/repos/BoltApp/bolt-magento1/pulls/comments/187785110","pull_request_review_id":119638634,"id":187785110,"diff_hunk":"@@ -951,15 +951,24 @@ public function getShippingAndTaxEstimate( $quote )\n     public function applyShippingRate($quote, $shippingRateCode) {\n         $shippingAddress = $quote->getShippingAddress();\n \n-        if(!empty($shippingAddress)) {\n+        if (!empty($shippingAddress)) {\n             // Unsetting address id is required to force collectTotals to recalculate discounts\n+            $shippingAddress->isObjectNew(true);\n             $shippingAddressId = $shippingAddress->getData('address_id');\n-            $shippingAddress->unsetData('address_id');\n \n             $shippingAddress->setShippingMethod($shippingRateCode);\n+\n+            $quoteItems = $quote->getAllItems();\n+            foreach ($quoteItems as $item) {\n+                $item->setData('discount_amount', $item->getOrigData('discount_amount'));\n+                $item->setData('base_discount_amount', $item->getOrigData('base_discount_amount'));\n+            }\n+\n             $quote->setTotalsCollectedFlag(false)->collectTotals();\n \n-            $shippingAddress->setData('address_id', $shippingAddressId);\n+            if(!empty($shippingAddressId) && $shippingAddressId != $shippingAddress->getData('address_id')) {","path":"app/code/community/Bolt/Boltpay/Helper/Api.php","position":22,"original_position":22,"commit_id":"88c4092d5c1b19830c5a37466eea5af545a09532","original_commit_id":"88c4092d5c1b19830c5a37466eea5af545a09532","user":{"login":"daisy1754","id":980077,"avatar_url":"https://avatars1.githubusercontent.com/u/980077?v=4","gravatar_id":"","url":"https://api.github.com/users/daisy1754","html_url":"https://github.com/daisy1754","followers_url":"https://api.github.com/users/daisy1754/followers","following_url":"https://api.github.com/users/daisy1754/following{/other_user}","gists_url":"https://api.github.com/users/daisy1754/gists{/gist_id}","starred_url":"https://api.github.com/users/daisy1754/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daisy1754/subscriptions","organizations_url":"https://api.github.com/users/daisy1754/orgs","repos_url":"https://api.github.com/users/daisy1754/repos","events_url":"https://api.github.com/users/daisy1754/events{/privacy}","received_events_url":"https://api.github.com/users/daisy1754/received_events","type":"User","site_admin":false},"body":"when `$shippingAddressId != $shippingAddress->getData('address_id')` becomes true?","created_at":"2018-05-12T23:01:32Z","updated_at":"2018-05-12T23:01:34Z","html_url":"https://github.com/BoltApp/bolt-magento1/pull/47#discussion_r187785110","pull_request_url":"https://api.github.com/repos/BoltApp/bolt-magento1/pulls/47","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/BoltApp/bolt-magento1/pulls/comments/187785110"},"html":{"href":"https://github.com/BoltApp/bolt-magento1/pull/47#discussion_r187785110"},"pull_request":{"href":"https://api.github.com/repos/BoltApp/bolt-magento1/pulls/47"}}},"pull_request":{"url":"https://api.github.com/repos/BoltApp/bolt-magento1/pulls/47","id":187558975,"html_url":"https://github.com/BoltApp/bolt-magento1/pull/47","diff_url":"https://github.com/BoltApp/bolt-magento1/pull/47.diff","patch_url":"https://github.com/BoltApp/bolt-magento1/pull/47.patch","issue_url":"https://api.github.com/repos/BoltApp/bolt-magento1/issues/47","number":47,"state":"open","locked":false,"title":"Bug collect totals shipping rate","user":{"login":"johnmccombs1","id":2002287,"avatar_url":"https://avatars3.githubusercontent.com/u/2002287?v=4","gravatar_id":"","url":"https://api.github.com/users/johnmccombs1","html_url":"https://github.com/johnmccombs1","followers_url":"https://api.github.com/users/johnmccombs1/followers","following_url":"https://api.github.com/users/johnmccombs1/following{/other_user}","gists_url":"https://api.github.com/users/johnmccombs1/gists{/gist_id}","starred_url":"https://api.github.com/users/johnmccombs1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnmccombs1/subscriptions","organizations_url":"https://api.github.com/users/johnmccombs1/orgs","repos_url":"https://api.github.com/users/johnmccombs1/repos","events_url":"https://api.github.com/users/johnmccombs1/events{/privacy}","received_events_url":"https://api.github.com/users/johnmccombs1/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-05-11T20:12:32Z","updated_at":"2018-05-12T23:01:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c5ad653eee19e388fa6d2c416fbac52b137ba06a","assignee":{"login":"daisy1754","id":980077,"avatar_url":"https://avatars1.githubusercontent.com/u/980077?v=4","gravatar_id":"","url":"https://api.github.com/users/daisy1754","html_url":"https://github.com/daisy1754","followers_url":"https://api.github.com/users/daisy1754/followers","following_url":"https://api.github.com/users/daisy1754/following{/other_user}","gists_url":"https://api.github.com/users/daisy1754/gists{/gist_id}","starred_url":"https://api.github.com/users/daisy1754/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daisy1754/subscriptions","organizations_url":"https://api.github.com/users/daisy1754/orgs","repos_url":"https://api.github.com/users/daisy1754/repos","events_url":"https://api.github.com/users/daisy1754/events{/privacy}","received_events_url":"https://api.github.com/users/daisy1754/received_events","type":"User","site_admin":false},"assignees":[{"login":"daisy1754","id":980077,"avatar_url":"https://avatars1.githubusercontent.com/u/980077?v=4","gravatar_id":"","url":"https://api.github.com/users/daisy1754","html_url":"https://github.com/daisy1754","followers_url":"https://api.github.com/users/daisy1754/followers","following_url":"https://api.github.com/users/daisy1754/following{/other_user}","gists_url":"https://api.github.com/users/daisy1754/gists{/gist_id}","starred_url":"https://api.github.com/users/daisy1754/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daisy1754/subscriptions","organizations_url":"https://api.github.com/users/daisy1754/orgs","repos_url":"https://api.github.com/users/daisy1754/repos","events_url":"https://api.github.com/users/daisy1754/events{/privacy}","received_events_url":"https://api.github.com/users/daisy1754/received_events","type":"User","site_admin":false},{"login":"jackliao-bolt","id":29990948,"avatar_url":"https://avatars3.githubusercontent.com/u/29990948?v=4","gravatar_id":"","url":"https://api.github.com/users/jackliao-bolt","html_url":"https://github.com/jackliao-bolt","followers_url":"https://api.github.com/users/jackliao-bolt/followers","following_url":"https://api.github.com/users/jackliao-bolt/following{/other_user}","gists_url":"https://api.github.com/users/jackliao-bolt/gists{/gist_id}","starred_url":"https://api.github.com/users/jackliao-bolt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jackliao-bolt/subscriptions","organizations_url":"https://api.github.com/users/jackliao-bolt/orgs","repos_url":"https://api.github.com/users/jackliao-bolt/repos","events_url":"https://api.github.com/users/jackliao-bolt/events{/privacy}","received_events_url":"https://api.github.com/users/jackliao-bolt/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/BoltApp/bolt-magento1/pulls/47/commits","review_comments_url":"https://api.github.com/repos/BoltApp/bolt-magento1/pulls/47/comments","review_comment_url":"https://api.github.com/repos/BoltApp/bolt-magento1/pulls/comments{/number}","comments_url":"https://api.github.com/repos/BoltApp/bolt-magento1/issues/47/comments","statuses_url":"https://api.github.com/repos/BoltApp/bolt-magento1/statuses/88c4092d5c1b19830c5a37466eea5af545a09532","head":{"label":"BoltApp:bug-collect-totals-shipping-rate","ref":"bug-collect-totals-shipping-rate","sha":"88c4092d5c1b19830c5a37466eea5af545a09532","user":{"login":"BoltApp","id":8142070,"avatar_url":"https://avatars1.githubusercontent.com/u/8142070?v=4","gravatar_id":"","url":"https://api.github.com/users/BoltApp","html_url":"https://github.com/BoltApp","followers_url":"https://api.github.com/users/BoltApp/followers","following_url":"https://api.github.com/users/BoltApp/following{/other_user}","gists_url":"https://api.github.com/users/BoltApp/gists{/gist_id}","starred_url":"https://api.github.com/users/BoltApp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BoltApp/subscriptions","organizations_url":"https://api.github.com/users/BoltApp/orgs","repos_url":"https://api.github.com/users/BoltApp/repos","events_url":"https://api.github.com/users/BoltApp/events{/privacy}","received_events_url":"https://api.github.com/users/BoltApp/received_events","type":"Organization","site_admin":false},"repo":{"id":125256996,"name":"bolt-magento1","full_name":"BoltApp/bolt-magento1","owner":{"login":"BoltApp","id":8142070,"avatar_url":"https://avatars1.githubusercontent.com/u/8142070?v=4","gravatar_id":"","url":"https://api.github.com/users/BoltApp","html_url":"https://github.com/BoltApp","followers_url":"https://api.github.com/users/BoltApp/followers","following_url":"https://api.github.com/users/BoltApp/following{/other_user}","gists_url":"https://api.github.com/users/BoltApp/gists{/gist_id}","starred_url":"https://api.github.com/users/BoltApp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BoltApp/subscriptions","organizations_url":"https://api.github.com/users/BoltApp/orgs","repos_url":"https://api.github.com/users/BoltApp/repos","events_url":"https://api.github.com/users/BoltApp/events{/privacy}","received_events_url":"https://api.github.com/users/BoltApp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/BoltApp/bolt-magento1","description":"Bolt plugin for magento1","fork":false,"url":"https://api.github.com/repos/BoltApp/bolt-magento1","forks_url":"https://api.github.com/repos/BoltApp/bolt-magento1/forks","keys_url":"https://api.github.com/repos/BoltApp/bolt-magento1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BoltApp/bolt-magento1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BoltApp/bolt-magento1/teams","hooks_url":"https://api.github.com/repos/BoltApp/bolt-magento1/hooks","issue_events_url":"https://api.github.com/repos/BoltApp/bolt-magento1/issues/events{/number}","events_url":"https://api.github.com/repos/BoltApp/bolt-magento1/events","assignees_url":"https://api.github.com/repos/BoltApp/bolt-magento1/assignees{/user}","branches_url":"https://api.github.com/repos/BoltApp/bolt-magento1/branches{/branch}","tags_url":"https://api.github.com/repos/BoltApp/bolt-magento1/tags","blobs_url":"https://api.github.com/repos/BoltApp/bolt-magento1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BoltApp/bolt-magento1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BoltApp/bolt-magento1/git/refs{/sha}","trees_url":"https://api.github.com/repos/BoltApp/bolt-magento1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BoltApp/bolt-magento1/statuses/{sha}","languages_url":"https://api.github.com/repos/BoltApp/bolt-magento1/languages","stargazers_url":"https://api.github.com/repos/BoltApp/bolt-magento1/stargazers","contributors_url":"https://api.github.com/repos/BoltApp/bolt-magento1/contributors","subscribers_url":"https://api.github.com/repos/BoltApp/bolt-magento1/subscribers","subscription_url":"https://api.github.com/repos/BoltApp/bolt-magento1/subscription","commits_url":"https://api.github.com/repos/BoltApp/bolt-magento1/commits{/sha}","git_commits_url":"https://api.github.com/repos/BoltApp/bolt-magento1/git/commits{/sha}","comments_url":"https://api.github.com/repos/BoltApp/bolt-magento1/comments{/number}","issue_comment_url":"https://api.github.com/repos/BoltApp/bolt-magento1/issues/comments{/number}","contents_url":"https://api.github.com/repos/BoltApp/bolt-magento1/contents/{+path}","compare_url":"https://api.github.com/repos/BoltApp/bolt-magento1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BoltApp/bolt-magento1/merges","archive_url":"https://api.github.com/repos/BoltApp/bolt-magento1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BoltApp/bolt-magento1/downloads","issues_url":"https://api.github.com/repos/BoltApp/bolt-magento1/issues{/number}","pulls_url":"https://api.github.com/repos/BoltApp/bolt-magento1/pulls{/number}","milestones_url":"https://api.github.com/repos/BoltApp/bolt-magento1/milestones{/number}","notifications_url":"https://api.github.com/repos/BoltApp/bolt-magento1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BoltApp/bolt-magento1/labels{/name}","releases_url":"https://api.github.com/repos/BoltApp/bolt-magento1/releases{/id}","deployments_url":"https://api.github.com/repos/BoltApp/bolt-magento1/deployments","created_at":"2018-03-14T18:30:30Z","updated_at":"2018-05-04T03:03:38Z","pushed_at":"2018-05-11T20:12:32Z","git_url":"git://github.com/BoltApp/bolt-magento1.git","ssh_url":"git@github.com:BoltApp/bolt-magento1.git","clone_url":"https://github.com/BoltApp/bolt-magento1.git","svn_url":"https://github.com/BoltApp/bolt-magento1","homepage":null,"size":1387,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":3,"license":null,"forks":1,"open_issues":3,"watchers":0,"default_branch":"develop"}},"base":{"label":"BoltApp:develop","ref":"develop","sha":"0e9d764cd6afb96241de7545f549d5b3d05197ec","user":{"login":"BoltApp","id":8142070,"avatar_url":"https://avatars1.githubusercontent.com/u/8142070?v=4","gravatar_id":"","url":"https://api.github.com/users/BoltApp","html_url":"https://github.com/BoltApp","followers_url":"https://api.github.com/users/BoltApp/followers","following_url":"https://api.github.com/users/BoltApp/following{/other_user}","gists_url":"https://api.github.com/users/BoltApp/gists{/gist_id}","starred_url":"https://api.github.com/users/BoltApp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BoltApp/subscriptions","organizations_url":"https://api.github.com/users/BoltApp/orgs","repos_url":"https://api.github.com/users/BoltApp/repos","events_url":"https://api.github.com/users/BoltApp/events{/privacy}","received_events_url":"https://api.github.com/users/BoltApp/received_events","type":"Organization","site_admin":false},"repo":{"id":125256996,"name":"bolt-magento1","full_name":"BoltApp/bolt-magento1","owner":{"login":"BoltApp","id":8142070,"avatar_url":"https://avatars1.githubusercontent.com/u/8142070?v=4","gravatar_id":"","url":"https://api.github.com/users/BoltApp","html_url":"https://github.com/BoltApp","followers_url":"https://api.github.com/users/BoltApp/followers","following_url":"https://api.github.com/users/BoltApp/following{/other_user}","gists_url":"https://api.github.com/users/BoltApp/gists{/gist_id}","starred_url":"https://api.github.com/users/BoltApp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BoltApp/subscriptions","organizations_url":"https://api.github.com/users/BoltApp/orgs","repos_url":"https://api.github.com/users/BoltApp/repos","events_url":"https://api.github.com/users/BoltApp/events{/privacy}","received_events_url":"https://api.github.com/users/BoltApp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/BoltApp/bolt-magento1","description":"Bolt plugin for magento1","fork":false,"url":"https://api.github.com/repos/BoltApp/bolt-magento1","forks_url":"https://api.github.com/repos/BoltApp/bolt-magento1/forks","keys_url":"https://api.github.com/repos/BoltApp/bolt-magento1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BoltApp/bolt-magento1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BoltApp/bolt-magento1/teams","hooks_url":"https://api.github.com/repos/BoltApp/bolt-magento1/hooks","issue_events_url":"https://api.github.com/repos/BoltApp/bolt-magento1/issues/events{/number}","events_url":"https://api.github.com/repos/BoltApp/bolt-magento1/events","assignees_url":"https://api.github.com/repos/BoltApp/bolt-magento1/assignees{/user}","branches_url":"https://api.github.com/repos/BoltApp/bolt-magento1/branches{/branch}","tags_url":"https://api.github.com/repos/BoltApp/bolt-magento1/tags","blobs_url":"https://api.github.com/repos/BoltApp/bolt-magento1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BoltApp/bolt-magento1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BoltApp/bolt-magento1/git/refs{/sha}","trees_url":"https://api.github.com/repos/BoltApp/bolt-magento1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BoltApp/bolt-magento1/statuses/{sha}","languages_url":"https://api.github.com/repos/BoltApp/bolt-magento1/languages","stargazers_url":"https://api.github.com/repos/BoltApp/bolt-magento1/stargazers","contributors_url":"https://api.github.com/repos/BoltApp/bolt-magento1/contributors","subscribers_url":"https://api.github.com/repos/BoltApp/bolt-magento1/subscribers","subscription_url":"https://api.github.com/repos/BoltApp/bolt-magento1/subscription","commits_url":"https://api.github.com/repos/BoltApp/bolt-magento1/commits{/sha}","git_commits_url":"https://api.github.com/repos/BoltApp/bolt-magento1/git/commits{/sha}","comments_url":"https://api.github.com/repos/BoltApp/bolt-magento1/comments{/number}","issue_comment_url":"https://api.github.com/repos/BoltApp/bolt-magento1/issues/comments{/number}","contents_url":"https://api.github.com/repos/BoltApp/bolt-magento1/contents/{+path}","compare_url":"https://api.github.com/repos/BoltApp/bolt-magento1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BoltApp/bolt-magento1/merges","archive_url":"https://api.github.com/repos/BoltApp/bolt-magento1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BoltApp/bolt-magento1/downloads","issues_url":"https://api.github.com/repos/BoltApp/bolt-magento1/issues{/number}","pulls_url":"https://api.github.com/repos/BoltApp/bolt-magento1/pulls{/number}","milestones_url":"https://api.github.com/repos/BoltApp/bolt-magento1/milestones{/number}","notifications_url":"https://api.github.com/repos/BoltApp/bolt-magento1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BoltApp/bolt-magento1/labels{/name}","releases_url":"https://api.github.com/repos/BoltApp/bolt-magento1/releases{/id}","deployments_url":"https://api.github.com/repos/BoltApp/bolt-magento1/deployments","created_at":"2018-03-14T18:30:30Z","updated_at":"2018-05-04T03:03:38Z","pushed_at":"2018-05-11T20:12:32Z","git_url":"git://github.com/BoltApp/bolt-magento1.git","ssh_url":"git@github.com:BoltApp/bolt-magento1.git","clone_url":"https://github.com/BoltApp/bolt-magento1.git","svn_url":"https://github.com/BoltApp/bolt-magento1","homepage":null,"size":1387,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":3,"license":null,"forks":1,"open_issues":3,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/BoltApp/bolt-magento1/pulls/47"},"html":{"href":"https://github.com/BoltApp/bolt-magento1/pull/47"},"issue":{"href":"https://api.github.com/repos/BoltApp/bolt-magento1/issues/47"},"comments":{"href":"https://api.github.com/repos/BoltApp/bolt-magento1/issues/47/comments"},"review_comments":{"href":"https://api.github.com/repos/BoltApp/bolt-magento1/pulls/47/comments"},"review_comment":{"href":"https://api.github.com/repos/BoltApp/bolt-magento1/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/BoltApp/bolt-magento1/pulls/47/commits"},"statuses":{"href":"https://api.github.com/repos/BoltApp/bolt-magento1/statuses/88c4092d5c1b19830c5a37466eea5af545a09532"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"daisy1754"}}