{"action":"opened","number":786,"pull_request":{"url":"https://api.github.com/repos/shopware/shopware/pulls/786","id":85799914,"html_url":"https://github.com/shopware/shopware/pull/786","diff_url":"https://github.com/shopware/shopware/pull/786.diff","patch_url":"https://github.com/shopware/shopware/pull/786.patch","issue_url":"https://api.github.com/repos/shopware/shopware/issues/786","number":786,"state":"open","locked":false,"title":"Do not show inactive product variants in bonus products","user":{"login":"jhit","id":537665,"avatar_url":"https://avatars.githubusercontent.com/u/537665?v=3","gravatar_id":"","url":"https://api.github.com/users/jhit","html_url":"https://github.com/jhit","followers_url":"https://api.github.com/users/jhit/followers","following_url":"https://api.github.com/users/jhit/following{/other_user}","gists_url":"https://api.github.com/users/jhit/gists{/gist_id}","starred_url":"https://api.github.com/users/jhit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhit/subscriptions","organizations_url":"https://api.github.com/users/jhit/orgs","repos_url":"https://api.github.com/users/jhit/repos","events_url":"https://api.github.com/users/jhit/events{/privacy}","received_events_url":"https://api.github.com/users/jhit/received_events","type":"User","site_admin":false},"body":"<!--\r\nThank you for contributing to Shopware!\r\n\r\nPlease take the time to edit the \"Answers\" rows with the necessary information.\r\nClick the form's \"Preview button\" to make sure the table is functional in GitHub.\r\n-->\r\n\r\n## Description\r\nPlease describe your pull request:\r\n* Why is it necessary?\r\n\r\nInactive product variants can be selected and added to the cart in the bonus product section of the cart.\r\nI think this should not be the case. If you show the customer a bonus product and allow to add it to cart the product has to be available.\r\n\r\n* What does it improve?\r\n\r\nTo achieve this I removed inactive variants from the selection and additionally added a template variable of the stock value to make it possible to hide variants that have no stock.\r\n Given the fact that not every store will manage stock levels, I did not add the stock check to the database query, but added the template variable. This way we can hide variants without stock with a template overwrite if desired.\r\n\r\n* Does it have side effects?\r\n\r\nI do not know any.\r\n\r\n\r\n| Questions        | Answers\r\n| ---------------- | -------------------------------------------------------\r\n| BC breaks?       | no\r\n| Tests pass?      | yes\r\n| Related tickets? | none found\r\n| How to test?     | setup demo store. Configure a bonus product with variants like the T-SHIRT LOGO TEE CHARCOAL. Set one variant to inactive. Fill your cart to match the bonus product criteria. validate that the inactive variant is not listed in the options. To check the template variable you need the shopware-profiler plugin. I will not go into details here. \r\n\r\n\r\n\r\n","created_at":"2016-09-19T14:07:14Z","updated_at":"2016-09-19T14:07:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/shopware/shopware/pulls/786/commits","review_comments_url":"https://api.github.com/repos/shopware/shopware/pulls/786/comments","review_comment_url":"https://api.github.com/repos/shopware/shopware/pulls/comments{/number}","comments_url":"https://api.github.com/repos/shopware/shopware/issues/786/comments","statuses_url":"https://api.github.com/repos/shopware/shopware/statuses/4659bdbcfade3947e65d4b85cafbf46d10afe66d","head":{"label":"sfxonline:5.2","ref":"5.2","sha":"4659bdbcfade3947e65d4b85cafbf46d10afe66d","user":{"login":"sfxonline","id":14936806,"avatar_url":"https://avatars.githubusercontent.com/u/14936806?v=3","gravatar_id":"","url":"https://api.github.com/users/sfxonline","html_url":"https://github.com/sfxonline","followers_url":"https://api.github.com/users/sfxonline/followers","following_url":"https://api.github.com/users/sfxonline/following{/other_user}","gists_url":"https://api.github.com/users/sfxonline/gists{/gist_id}","starred_url":"https://api.github.com/users/sfxonline/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sfxonline/subscriptions","organizations_url":"https://api.github.com/users/sfxonline/orgs","repos_url":"https://api.github.com/users/sfxonline/repos","events_url":"https://api.github.com/users/sfxonline/events{/privacy}","received_events_url":"https://api.github.com/users/sfxonline/received_events","type":"Organization","site_admin":false},"repo":{"id":68607143,"name":"shopware","full_name":"sfxonline/shopware","owner":{"login":"sfxonline","id":14936806,"avatar_url":"https://avatars.githubusercontent.com/u/14936806?v=3","gravatar_id":"","url":"https://api.github.com/users/sfxonline","html_url":"https://github.com/sfxonline","followers_url":"https://api.github.com/users/sfxonline/followers","following_url":"https://api.github.com/users/sfxonline/following{/other_user}","gists_url":"https://api.github.com/users/sfxonline/gists{/gist_id}","starred_url":"https://api.github.com/users/sfxonline/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sfxonline/subscriptions","organizations_url":"https://api.github.com/users/sfxonline/orgs","repos_url":"https://api.github.com/users/sfxonline/repos","events_url":"https://api.github.com/users/sfxonline/events{/privacy}","received_events_url":"https://api.github.com/users/sfxonline/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sfxonline/shopware","description":"Shopware Repository","fork":true,"url":"https://api.github.com/repos/sfxonline/shopware","forks_url":"https://api.github.com/repos/sfxonline/shopware/forks","keys_url":"https://api.github.com/repos/sfxonline/shopware/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sfxonline/shopware/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sfxonline/shopware/teams","hooks_url":"https://api.github.com/repos/sfxonline/shopware/hooks","issue_events_url":"https://api.github.com/repos/sfxonline/shopware/issues/events{/number}","events_url":"https://api.github.com/repos/sfxonline/shopware/events","assignees_url":"https://api.github.com/repos/sfxonline/shopware/assignees{/user}","branches_url":"https://api.github.com/repos/sfxonline/shopware/branches{/branch}","tags_url":"https://api.github.com/repos/sfxonline/shopware/tags","blobs_url":"https://api.github.com/repos/sfxonline/shopware/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sfxonline/shopware/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sfxonline/shopware/git/refs{/sha}","trees_url":"https://api.github.com/repos/sfxonline/shopware/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sfxonline/shopware/statuses/{sha}","languages_url":"https://api.github.com/repos/sfxonline/shopware/languages","stargazers_url":"https://api.github.com/repos/sfxonline/shopware/stargazers","contributors_url":"https://api.github.com/repos/sfxonline/shopware/contributors","subscribers_url":"https://api.github.com/repos/sfxonline/shopware/subscribers","subscription_url":"https://api.github.com/repos/sfxonline/shopware/subscription","commits_url":"https://api.github.com/repos/sfxonline/shopware/commits{/sha}","git_commits_url":"https://api.github.com/repos/sfxonline/shopware/git/commits{/sha}","comments_url":"https://api.github.com/repos/sfxonline/shopware/comments{/number}","issue_comment_url":"https://api.github.com/repos/sfxonline/shopware/issues/comments{/number}","contents_url":"https://api.github.com/repos/sfxonline/shopware/contents/{+path}","compare_url":"https://api.github.com/repos/sfxonline/shopware/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sfxonline/shopware/merges","archive_url":"https://api.github.com/repos/sfxonline/shopware/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sfxonline/shopware/downloads","issues_url":"https://api.github.com/repos/sfxonline/shopware/issues{/number}","pulls_url":"https://api.github.com/repos/sfxonline/shopware/pulls{/number}","milestones_url":"https://api.github.com/repos/sfxonline/shopware/milestones{/number}","notifications_url":"https://api.github.com/repos/sfxonline/shopware/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sfxonline/shopware/labels{/name}","releases_url":"https://api.github.com/repos/sfxonline/shopware/releases{/id}","deployments_url":"https://api.github.com/repos/sfxonline/shopware/deployments","created_at":"2016-09-19T13:12:24Z","updated_at":"2016-09-19T13:12:44Z","pushed_at":"2016-09-19T13:37:19Z","git_url":"git://github.com/sfxonline/shopware.git","ssh_url":"git@github.com:sfxonline/shopware.git","clone_url":"https://github.com/sfxonline/shopware.git","svn_url":"https://github.com/sfxonline/shopware","homepage":"http://www.shopware.com","size":173336,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"5.2"}},"base":{"label":"shopware:5.2","ref":"5.2","sha":"7b6ffd737a64007d700fff3a7b214a941a733957","user":{"login":"shopware","id":612628,"avatar_url":"https://avatars.githubusercontent.com/u/612628?v=3","gravatar_id":"","url":"https://api.github.com/users/shopware","html_url":"https://github.com/shopware","followers_url":"https://api.github.com/users/shopware/followers","following_url":"https://api.github.com/users/shopware/following{/other_user}","gists_url":"https://api.github.com/users/shopware/gists{/gist_id}","starred_url":"https://api.github.com/users/shopware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shopware/subscriptions","organizations_url":"https://api.github.com/users/shopware/orgs","repos_url":"https://api.github.com/users/shopware/repos","events_url":"https://api.github.com/users/shopware/events{/privacy}","received_events_url":"https://api.github.com/users/shopware/received_events","type":"Organization","site_admin":false},"repo":{"id":5682970,"name":"shopware","full_name":"shopware/shopware","owner":{"login":"shopware","id":612628,"avatar_url":"https://avatars.githubusercontent.com/u/612628?v=3","gravatar_id":"","url":"https://api.github.com/users/shopware","html_url":"https://github.com/shopware","followers_url":"https://api.github.com/users/shopware/followers","following_url":"https://api.github.com/users/shopware/following{/other_user}","gists_url":"https://api.github.com/users/shopware/gists{/gist_id}","starred_url":"https://api.github.com/users/shopware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shopware/subscriptions","organizations_url":"https://api.github.com/users/shopware/orgs","repos_url":"https://api.github.com/users/shopware/repos","events_url":"https://api.github.com/users/shopware/events{/privacy}","received_events_url":"https://api.github.com/users/shopware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/shopware/shopware","description":"Shopware Repository","fork":false,"url":"https://api.github.com/repos/shopware/shopware","forks_url":"https://api.github.com/repos/shopware/shopware/forks","keys_url":"https://api.github.com/repos/shopware/shopware/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shopware/shopware/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shopware/shopware/teams","hooks_url":"https://api.github.com/repos/shopware/shopware/hooks","issue_events_url":"https://api.github.com/repos/shopware/shopware/issues/events{/number}","events_url":"https://api.github.com/repos/shopware/shopware/events","assignees_url":"https://api.github.com/repos/shopware/shopware/assignees{/user}","branches_url":"https://api.github.com/repos/shopware/shopware/branches{/branch}","tags_url":"https://api.github.com/repos/shopware/shopware/tags","blobs_url":"https://api.github.com/repos/shopware/shopware/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shopware/shopware/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shopware/shopware/git/refs{/sha}","trees_url":"https://api.github.com/repos/shopware/shopware/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shopware/shopware/statuses/{sha}","languages_url":"https://api.github.com/repos/shopware/shopware/languages","stargazers_url":"https://api.github.com/repos/shopware/shopware/stargazers","contributors_url":"https://api.github.com/repos/shopware/shopware/contributors","subscribers_url":"https://api.github.com/repos/shopware/shopware/subscribers","subscription_url":"https://api.github.com/repos/shopware/shopware/subscription","commits_url":"https://api.github.com/repos/shopware/shopware/commits{/sha}","git_commits_url":"https://api.github.com/repos/shopware/shopware/git/commits{/sha}","comments_url":"https://api.github.com/repos/shopware/shopware/comments{/number}","issue_comment_url":"https://api.github.com/repos/shopware/shopware/issues/comments{/number}","contents_url":"https://api.github.com/repos/shopware/shopware/contents/{+path}","compare_url":"https://api.github.com/repos/shopware/shopware/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shopware/shopware/merges","archive_url":"https://api.github.com/repos/shopware/shopware/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shopware/shopware/downloads","issues_url":"https://api.github.com/repos/shopware/shopware/issues{/number}","pulls_url":"https://api.github.com/repos/shopware/shopware/pulls{/number}","milestones_url":"https://api.github.com/repos/shopware/shopware/milestones{/number}","notifications_url":"https://api.github.com/repos/shopware/shopware/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shopware/shopware/labels{/name}","releases_url":"https://api.github.com/repos/shopware/shopware/releases{/id}","deployments_url":"https://api.github.com/repos/shopware/shopware/deployments","created_at":"2012-09-05T05:32:50Z","updated_at":"2016-09-19T10:23:38Z","pushed_at":"2016-09-19T12:42:12Z","git_url":"git://github.com/shopware/shopware.git","ssh_url":"git@github.com:shopware/shopware.git","clone_url":"https://github.com/shopware/shopware.git","svn_url":"https://github.com/shopware/shopware","homepage":"http://www.shopware.com","size":173336,"stargazers_count":519,"watchers_count":519,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":354,"mirror_url":null,"open_issues_count":122,"forks":354,"open_issues":122,"watchers":519,"default_branch":"5.2"}},"_links":{"self":{"href":"https://api.github.com/repos/shopware/shopware/pulls/786"},"html":{"href":"https://github.com/shopware/shopware/pull/786"},"issue":{"href":"https://api.github.com/repos/shopware/shopware/issues/786"},"comments":{"href":"https://api.github.com/repos/shopware/shopware/issues/786/comments"},"review_comments":{"href":"https://api.github.com/repos/shopware/shopware/pulls/786/comments"},"review_comment":{"href":"https://api.github.com/repos/shopware/shopware/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/shopware/shopware/pulls/786/commits"},"statuses":{"href":"https://api.github.com/repos/shopware/shopware/statuses/4659bdbcfade3947e65d4b85cafbf46d10afe66d"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":5,"deletions":3,"changed_files":1}}
{"actor":{"display_login":"jhit"}}