{"action":"created","issue":{"url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/issues/2978","labels_url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/issues/2978/labels{/name}","comments_url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/issues/2978/comments","events_url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/issues/2978/events","html_url":"https://github.com/easydigitaldownloads/Easy-Digital-Downloads/issues/2978","id":54735655,"number":2978,"title":"Missing ID Check in Sales Log Table $amount assignment.","user":{"login":"danieliser","id":847818,"avatar_url":"https://avatars.githubusercontent.com/u/847818?v=3","gravatar_id":"","url":"https://api.github.com/users/danieliser","html_url":"https://github.com/danieliser","followers_url":"https://api.github.com/users/danieliser/followers","following_url":"https://api.github.com/users/danieliser/following{/other_user}","gists_url":"https://api.github.com/users/danieliser/gists{/gist_id}","starred_url":"https://api.github.com/users/danieliser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danieliser/subscriptions","organizations_url":"https://api.github.com/users/danieliser/orgs","repos_url":"https://api.github.com/users/danieliser/repos","events_url":"https://api.github.com/users/danieliser/events{/privacy}","received_events_url":"https://api.github.com/users/danieliser/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/labels/Bug","name":"Bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":{"login":"cklosowski","id":1390124,"avatar_url":"https://avatars.githubusercontent.com/u/1390124?v=3","gravatar_id":"","url":"https://api.github.com/users/cklosowski","html_url":"https://github.com/cklosowski","followers_url":"https://api.github.com/users/cklosowski/followers","following_url":"https://api.github.com/users/cklosowski/following{/other_user}","gists_url":"https://api.github.com/users/cklosowski/gists{/gist_id}","starred_url":"https://api.github.com/users/cklosowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cklosowski/subscriptions","organizations_url":"https://api.github.com/users/cklosowski/orgs","repos_url":"https://api.github.com/users/cklosowski/repos","events_url":"https://api.github.com/users/cklosowski/events{/privacy}","received_events_url":"https://api.github.com/users/cklosowski/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/milestones/81","labels_url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/milestones/81/labels","id":824150,"number":81,"title":"2.3","description":"","creator":{"login":"pippinsplugins","id":1034109,"avatar_url":"https://avatars.githubusercontent.com/u/1034109?v=3","gravatar_id":"","url":"https://api.github.com/users/pippinsplugins","html_url":"https://github.com/pippinsplugins","followers_url":"https://api.github.com/users/pippinsplugins/followers","following_url":"https://api.github.com/users/pippinsplugins/following{/other_user}","gists_url":"https://api.github.com/users/pippinsplugins/gists{/gist_id}","starred_url":"https://api.github.com/users/pippinsplugins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pippinsplugins/subscriptions","organizations_url":"https://api.github.com/users/pippinsplugins/orgs","repos_url":"https://api.github.com/users/pippinsplugins/repos","events_url":"https://api.github.com/users/pippinsplugins/events{/privacy}","received_events_url":"https://api.github.com/users/pippinsplugins/received_events","type":"User","site_admin":false},"open_issues":30,"closed_issues":81,"state":"open","created_at":"2014-10-13T16:09:32Z","updated_at":"2015-02-20T15:03:52Z","due_on":"2015-03-06T06:00:00Z","closed_at":null},"comments":4,"created_at":"2015-01-19T08:00:56Z","updated_at":"2015-02-20T15:25:22Z","closed_at":"2015-02-20T15:03:52Z","body":"Looking at these 3 lines here.  https://github.com/easydigitaldownloads/Easy-Digital-Downloads/blob/master/includes/admin/reporting/class-sales-logs-list-table.php#L302\r\n\r\nThis doesn't seem correct. It will default to showing the last items price not the correct items price.\r\n\r\nThis became apparent when using custom prices with the bonus product enabled. The second item in cart has cost of 0.00 and in the sales log table it shows $0.00 even though I just entered and test payed $1000.00.\r\n\r\nI fixed this by changing it to this.\r\n\r\n\tforeach ( $cart_items as $item ) {\r\n\t\tif( $item['id'] == $log->post_parent ) {\r\n\t\t\t$amount = isset( $item['item_price'] ) ? $item['item_price'] : $item['price'];\r\n\t\t}\r\n\t}\r\n\r\nFound this because I was using this code as a reference for another function. The above does resolve the issue both in sales log report table and in my usage."},"comment":{"url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/issues/comments/75255506","html_url":"https://github.com/easydigitaldownloads/Easy-Digital-Downloads/issues/2978#issuecomment-75255506","issue_url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/issues/2978","id":75255506,"user":{"login":"pippinsplugins","id":1034109,"avatar_url":"https://avatars.githubusercontent.com/u/1034109?v=3","gravatar_id":"","url":"https://api.github.com/users/pippinsplugins","html_url":"https://github.com/pippinsplugins","followers_url":"https://api.github.com/users/pippinsplugins/followers","following_url":"https://api.github.com/users/pippinsplugins/following{/other_user}","gists_url":"https://api.github.com/users/pippinsplugins/gists{/gist_id}","starred_url":"https://api.github.com/users/pippinsplugins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pippinsplugins/subscriptions","organizations_url":"https://api.github.com/users/pippinsplugins/orgs","repos_url":"https://api.github.com/users/pippinsplugins/repos","events_url":"https://api.github.com/users/pippinsplugins/events{/privacy}","received_events_url":"https://api.github.com/users/pippinsplugins/received_events","type":"User","site_admin":false},"created_at":"2015-02-20T15:25:22Z","updated_at":"2015-02-20T15:25:22Z","body":":+1:\n\nOn Fri, Feb 20, 2015 at 9:11 AM, Daniel Iser <notifications@github.com>\nwrote:\n\n> Just tested. looks good on my end.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/easydigitaldownloads/Easy-Digital-Downloads/issues/2978#issuecomment-75253174>\n> .\n>\n"}}