{"action":"created","issue":{"url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/issues/3305","labels_url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/issues/3305/labels{/name}","comments_url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/issues/3305/comments","events_url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/issues/3305/events","html_url":"https://github.com/easydigitaldownloads/Easy-Digital-Downloads/issues/3305","id":64130927,"number":3305,"title":"Allow hiding of empty cart widget. Show on add to cart.","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/Enhancement","name":"Enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/labels/Needs%20Dev%20Feedback","name":"Needs Dev Feedback","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":19,"created_at":"2015-03-25T00:07:46Z","updated_at":"2015-07-24T17:10:28Z","closed_at":null,"body":"The following filter makes this quite easy to do.\r\n\r\n\tadd_filter( 'dynamic_sidebar_params', 'hide_empty_cart_widgets' );\r\n\r\n\tfunction hide_empty_cart_widgets( $params ) {\t\r\n\t\tif( strpos( $params[0]['widget_id'], 'edd_cart_widget' ) !== false && ! edd_get_cart_contents() ) {\r\n\t\t\t$class = 'class=\"edd-cart-empty ';\r\n\t\t\t$params[0]['before_widget'] = str_replace( 'class=\"', $class, $params[0]['before_widget'] );\r\n\t\t}\r\n\t\treturn $params;\r\n\t}\r\n\r\nUsing it now for a new theme. Then in the EDD add to cart js we simply remove that class from any widgets.\r\n\r\nThis can be hidden globally or users can choose to over ride it per sidebar using CSS."},"comment":{"url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/issues/comments/124582841","html_url":"https://github.com/easydigitaldownloads/Easy-Digital-Downloads/issues/3305#issuecomment-124582841","issue_url":"https://api.github.com/repos/easydigitaldownloads/Easy-Digital-Downloads/issues/3305","id":124582841,"user":{"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},"created_at":"2015-07-24T17:10:28Z","updated_at":"2015-07-24T17:10:28Z","body":"@danieliser Yeah I think that's probably best. Seems like we're on the right track."}}