{"action":"created","issue":{"url":"https://api.github.com/repos/givingforum/givingforum/issues/131","labels_url":"https://api.github.com/repos/givingforum/givingforum/issues/131/labels{/name}","comments_url":"https://api.github.com/repos/givingforum/givingforum/issues/131/comments","events_url":"https://api.github.com/repos/givingforum/givingforum/issues/131/events","html_url":"https://github.com/givingforum/givingforum/issues/131","id":33197013,"number":131,"title":"Authorization Code for Events (to allow/block registration)","user":{"login":"canheier","id":4732228,"avatar_url":"https://avatars.githubusercontent.com/u/4732228?v=3","gravatar_id":"","url":"https://api.github.com/users/canheier","html_url":"https://github.com/canheier","followers_url":"https://api.github.com/users/canheier/followers","following_url":"https://api.github.com/users/canheier/following{/other_user}","gists_url":"https://api.github.com/users/canheier/gists{/gist_id}","starred_url":"https://api.github.com/users/canheier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/canheier/subscriptions","organizations_url":"https://api.github.com/users/canheier/orgs","repos_url":"https://api.github.com/users/canheier/repos","events_url":"https://api.github.com/users/canheier/events{/privacy}","received_events_url":"https://api.github.com/users/canheier/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/givingforum/givingforum/labels/Group%20Feedback%20Needed","name":"Group Feedback Needed","color":"5319e7"}],"state":"open","locked":false,"assignee":{"login":"canheier","id":4732228,"avatar_url":"https://avatars.githubusercontent.com/u/4732228?v=3","gravatar_id":"","url":"https://api.github.com/users/canheier","html_url":"https://github.com/canheier","followers_url":"https://api.github.com/users/canheier/followers","following_url":"https://api.github.com/users/canheier/following{/other_user}","gists_url":"https://api.github.com/users/canheier/gists{/gist_id}","starred_url":"https://api.github.com/users/canheier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/canheier/subscriptions","organizations_url":"https://api.github.com/users/canheier/orgs","repos_url":"https://api.github.com/users/canheier/repos","events_url":"https://api.github.com/users/canheier/events{/privacy}","received_events_url":"https://api.github.com/users/canheier/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2014-05-09T18:34:55Z","updated_at":"2015-07-27T21:08:58Z","closed_at":null,"body":"Scenario: create authorization code for specific event - users must enter code to move on to register. This could be used if you want to restrict registration for an event to a specific group. \r\n \r\n1. Added the authorization code field to line item types http://test-scg.gotpantheon.com/admin/commerce/config/line-items/product/fields.\r\n \r\n2. Added some custom CSS to tell it to only display on one event http://test-scg.gotpantheon.com/events/test-event-show-code:\r\n \r\n/* --  displays auth code on following events -- */\r\n#node-event-733 #edit-line-item-fields-field-authorization-code {display: block;}\r\n \r\n/* --  hides auth code on all other events -- */\r\n#edit-line-item-fields-field-authorization-code {display: none;}\r\n \r\n3. Created rule that should only apply to one product based on sku: http://test-scg.gotpantheon.com/admin/config/workflow/rules/reaction/manage/rules_authorization_code_check\r\n-- Rule shows message when the code is wrong (this works).\r\n\r\n-- If the code is wrong, the rule should clear the contents of the shopping cart (this does not work). Instead, it adds the product to cart but also gives you the message that the code is wrong. https://docs.google.com/file/d/0B9QQVjpIBnoAV2hZc1FzVEVENEU/edit?usp=drivesdk\r\n \r\n-- If the code is correct, proceed as normal – product is added to cart (this works).\r\n \r\nThere’s two issues here:\r\n#1 – In order to make the authorization code actually block the user you have to make it a required field. However, it looks like doing so has to be done at the line item level making it required for all events.  Even though you can’t see the authorization code (because of the custom css) on other events like http://test-scg.gotpantheon.com/events/focus-stemarts-education-amplifying-collective-impact when you click register you get the message that the authorization code is required. How can we get around this?\r\n \r\n#2 – it doesn’t seem like the “remove all products from cart” is actually working here…it doesn’t empty the cart. Maybe there’s a better way to organize this – could the authorization code be required at a different stage of the process? The user could add the item to their cart and then when they click “checkout” are prompted to enter the code? At that point the product is in their cart and if the code is wrong, the rule would empty the cart?"},"comment":{"url":"https://api.github.com/repos/givingforum/givingforum/issues/comments/125343129","html_url":"https://github.com/givingforum/givingforum/issues/131#issuecomment-125343129","issue_url":"https://api.github.com/repos/givingforum/givingforum/issues/131","id":125343129,"user":{"login":"vrozansky","id":2983264,"avatar_url":"https://avatars.githubusercontent.com/u/2983264?v=3","gravatar_id":"","url":"https://api.github.com/users/vrozansky","html_url":"https://github.com/vrozansky","followers_url":"https://api.github.com/users/vrozansky/followers","following_url":"https://api.github.com/users/vrozansky/following{/other_user}","gists_url":"https://api.github.com/users/vrozansky/gists{/gist_id}","starred_url":"https://api.github.com/users/vrozansky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vrozansky/subscriptions","organizations_url":"https://api.github.com/users/vrozansky/orgs","repos_url":"https://api.github.com/users/vrozansky/repos","events_url":"https://api.github.com/users/vrozansky/events{/privacy}","received_events_url":"https://api.github.com/users/vrozansky/received_events","type":"User","site_admin":false},"created_at":"2015-07-27T21:08:58Z","updated_at":"2015-07-27T21:08:58Z","body":"@dbradyforum - please capture documentation in this ticket for our Wiki and resolve this ticket. Thank you."}}