{"action":"opened","number":11,"pull_request":{"url":"https://api.github.com/repos/PrestaShop/crossselling/pulls/11","id":40467031,"html_url":"https://github.com/PrestaShop/crossselling/pull/11","diff_url":"https://github.com/PrestaShop/crossselling/pull/11.diff","patch_url":"https://github.com/PrestaShop/crossselling/pull/11.patch","issue_url":"https://api.github.com/repos/PrestaShop/crossselling/issues/11","number":11,"state":"open","locked":false,"title":"Allow proper override, reduce code duplication. ","user":{"login":"alexsegura","id":1162230,"avatar_url":"https://avatars.githubusercontent.com/u/1162230?v=3","gravatar_id":"","url":"https://api.github.com/users/alexsegura","html_url":"https://github.com/alexsegura","followers_url":"https://api.github.com/users/alexsegura/followers","following_url":"https://api.github.com/users/alexsegura/following{/other_user}","gists_url":"https://api.github.com/users/alexsegura/gists{/gist_id}","starred_url":"https://api.github.com/users/alexsegura/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexsegura/subscriptions","organizations_url":"https://api.github.com/users/alexsegura/orgs","repos_url":"https://api.github.com/users/alexsegura/repos","events_url":"https://api.github.com/users/alexsegura/events{/privacy}","received_events_url":"https://api.github.com/users/alexsegura/received_events","type":"User","site_admin":false},"body":"Hello, \r\n\r\nI needed to override this module but I realized it did not allow easy override: if one wants to add some extra keys to the `$orderProducts` Smarty variable, one needs to override the whole `hookshoppingCart` or `hookProductFooter` method. \r\n\r\nAlso, the code of `hookshoppingCart` and `hookProductFooter` methods could be factorized, because they do more or less the same. \r\n\r\nI added a `protected getOrderProducts` method which is used by both hook methods and can be reimplemented easily by overrides. \r\n\r\nI also fixed the cache key calculation in the `hookshoppingCart` method, because `(int) array(1, 2, 3)` actually returns `1`. \r\n\r\nThere are several commits so that you can view incremental changes. \r\nIf this PR is OK for you, tell me and I'll squash the commits to have only one. \r\n","created_at":"2015-07-21T15:01:07Z","updated_at":"2015-07-21T15:01:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/PrestaShop/crossselling/pulls/11/commits","review_comments_url":"https://api.github.com/repos/PrestaShop/crossselling/pulls/11/comments","review_comment_url":"https://api.github.com/repos/PrestaShop/crossselling/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PrestaShop/crossselling/issues/11/comments","statuses_url":"https://api.github.com/repos/PrestaShop/crossselling/statuses/3cd913dccf33a721a0609b0034aea340c7a4d518","head":{"label":"alexsegura:refactor","ref":"refactor","sha":"3cd913dccf33a721a0609b0034aea340c7a4d518","user":{"login":"alexsegura","id":1162230,"avatar_url":"https://avatars.githubusercontent.com/u/1162230?v=3","gravatar_id":"","url":"https://api.github.com/users/alexsegura","html_url":"https://github.com/alexsegura","followers_url":"https://api.github.com/users/alexsegura/followers","following_url":"https://api.github.com/users/alexsegura/following{/other_user}","gists_url":"https://api.github.com/users/alexsegura/gists{/gist_id}","starred_url":"https://api.github.com/users/alexsegura/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexsegura/subscriptions","organizations_url":"https://api.github.com/users/alexsegura/orgs","repos_url":"https://api.github.com/users/alexsegura/repos","events_url":"https://api.github.com/users/alexsegura/events{/privacy}","received_events_url":"https://api.github.com/users/alexsegura/received_events","type":"User","site_admin":false},"repo":{"id":39447156,"name":"crossselling","full_name":"alexsegura/crossselling","owner":{"login":"alexsegura","id":1162230,"avatar_url":"https://avatars.githubusercontent.com/u/1162230?v=3","gravatar_id":"","url":"https://api.github.com/users/alexsegura","html_url":"https://github.com/alexsegura","followers_url":"https://api.github.com/users/alexsegura/followers","following_url":"https://api.github.com/users/alexsegura/following{/other_user}","gists_url":"https://api.github.com/users/alexsegura/gists{/gist_id}","starred_url":"https://api.github.com/users/alexsegura/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexsegura/subscriptions","organizations_url":"https://api.github.com/users/alexsegura/orgs","repos_url":"https://api.github.com/users/alexsegura/repos","events_url":"https://api.github.com/users/alexsegura/events{/privacy}","received_events_url":"https://api.github.com/users/alexsegura/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alexsegura/crossselling","description":"","fork":true,"url":"https://api.github.com/repos/alexsegura/crossselling","forks_url":"https://api.github.com/repos/alexsegura/crossselling/forks","keys_url":"https://api.github.com/repos/alexsegura/crossselling/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alexsegura/crossselling/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alexsegura/crossselling/teams","hooks_url":"https://api.github.com/repos/alexsegura/crossselling/hooks","issue_events_url":"https://api.github.com/repos/alexsegura/crossselling/issues/events{/number}","events_url":"https://api.github.com/repos/alexsegura/crossselling/events","assignees_url":"https://api.github.com/repos/alexsegura/crossselling/assignees{/user}","branches_url":"https://api.github.com/repos/alexsegura/crossselling/branches{/branch}","tags_url":"https://api.github.com/repos/alexsegura/crossselling/tags","blobs_url":"https://api.github.com/repos/alexsegura/crossselling/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alexsegura/crossselling/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alexsegura/crossselling/git/refs{/sha}","trees_url":"https://api.github.com/repos/alexsegura/crossselling/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alexsegura/crossselling/statuses/{sha}","languages_url":"https://api.github.com/repos/alexsegura/crossselling/languages","stargazers_url":"https://api.github.com/repos/alexsegura/crossselling/stargazers","contributors_url":"https://api.github.com/repos/alexsegura/crossselling/contributors","subscribers_url":"https://api.github.com/repos/alexsegura/crossselling/subscribers","subscription_url":"https://api.github.com/repos/alexsegura/crossselling/subscription","commits_url":"https://api.github.com/repos/alexsegura/crossselling/commits{/sha}","git_commits_url":"https://api.github.com/repos/alexsegura/crossselling/git/commits{/sha}","comments_url":"https://api.github.com/repos/alexsegura/crossselling/comments{/number}","issue_comment_url":"https://api.github.com/repos/alexsegura/crossselling/issues/comments{/number}","contents_url":"https://api.github.com/repos/alexsegura/crossselling/contents/{+path}","compare_url":"https://api.github.com/repos/alexsegura/crossselling/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alexsegura/crossselling/merges","archive_url":"https://api.github.com/repos/alexsegura/crossselling/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alexsegura/crossselling/downloads","issues_url":"https://api.github.com/repos/alexsegura/crossselling/issues{/number}","pulls_url":"https://api.github.com/repos/alexsegura/crossselling/pulls{/number}","milestones_url":"https://api.github.com/repos/alexsegura/crossselling/milestones{/number}","notifications_url":"https://api.github.com/repos/alexsegura/crossselling/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alexsegura/crossselling/labels{/name}","releases_url":"https://api.github.com/repos/alexsegura/crossselling/releases{/id}","created_at":"2015-07-21T13:34:53Z","updated_at":"2015-07-21T13:34:53Z","pushed_at":"2015-07-21T14:49:06Z","git_url":"git://github.com/alexsegura/crossselling.git","ssh_url":"git@github.com:alexsegura/crossselling.git","clone_url":"https://github.com/alexsegura/crossselling.git","svn_url":"https://github.com/alexsegura/crossselling","homepage":"http://www.prestashop.com","size":304,"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":"master"}},"base":{"label":"PrestaShop:master","ref":"master","sha":"430d2be8c76787c2b177a66b8f80f2fd085fec24","user":{"login":"PrestaShop","id":2815696,"avatar_url":"https://avatars.githubusercontent.com/u/2815696?v=3","gravatar_id":"","url":"https://api.github.com/users/PrestaShop","html_url":"https://github.com/PrestaShop","followers_url":"https://api.github.com/users/PrestaShop/followers","following_url":"https://api.github.com/users/PrestaShop/following{/other_user}","gists_url":"https://api.github.com/users/PrestaShop/gists{/gist_id}","starred_url":"https://api.github.com/users/PrestaShop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PrestaShop/subscriptions","organizations_url":"https://api.github.com/users/PrestaShop/orgs","repos_url":"https://api.github.com/users/PrestaShop/repos","events_url":"https://api.github.com/users/PrestaShop/events{/privacy}","received_events_url":"https://api.github.com/users/PrestaShop/received_events","type":"Organization","site_admin":false},"repo":{"id":17943175,"name":"crossselling","full_name":"PrestaShop/crossselling","owner":{"login":"PrestaShop","id":2815696,"avatar_url":"https://avatars.githubusercontent.com/u/2815696?v=3","gravatar_id":"","url":"https://api.github.com/users/PrestaShop","html_url":"https://github.com/PrestaShop","followers_url":"https://api.github.com/users/PrestaShop/followers","following_url":"https://api.github.com/users/PrestaShop/following{/other_user}","gists_url":"https://api.github.com/users/PrestaShop/gists{/gist_id}","starred_url":"https://api.github.com/users/PrestaShop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PrestaShop/subscriptions","organizations_url":"https://api.github.com/users/PrestaShop/orgs","repos_url":"https://api.github.com/users/PrestaShop/repos","events_url":"https://api.github.com/users/PrestaShop/events{/privacy}","received_events_url":"https://api.github.com/users/PrestaShop/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PrestaShop/crossselling","description":"","fork":false,"url":"https://api.github.com/repos/PrestaShop/crossselling","forks_url":"https://api.github.com/repos/PrestaShop/crossselling/forks","keys_url":"https://api.github.com/repos/PrestaShop/crossselling/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PrestaShop/crossselling/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PrestaShop/crossselling/teams","hooks_url":"https://api.github.com/repos/PrestaShop/crossselling/hooks","issue_events_url":"https://api.github.com/repos/PrestaShop/crossselling/issues/events{/number}","events_url":"https://api.github.com/repos/PrestaShop/crossselling/events","assignees_url":"https://api.github.com/repos/PrestaShop/crossselling/assignees{/user}","branches_url":"https://api.github.com/repos/PrestaShop/crossselling/branches{/branch}","tags_url":"https://api.github.com/repos/PrestaShop/crossselling/tags","blobs_url":"https://api.github.com/repos/PrestaShop/crossselling/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PrestaShop/crossselling/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PrestaShop/crossselling/git/refs{/sha}","trees_url":"https://api.github.com/repos/PrestaShop/crossselling/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PrestaShop/crossselling/statuses/{sha}","languages_url":"https://api.github.com/repos/PrestaShop/crossselling/languages","stargazers_url":"https://api.github.com/repos/PrestaShop/crossselling/stargazers","contributors_url":"https://api.github.com/repos/PrestaShop/crossselling/contributors","subscribers_url":"https://api.github.com/repos/PrestaShop/crossselling/subscribers","subscription_url":"https://api.github.com/repos/PrestaShop/crossselling/subscription","commits_url":"https://api.github.com/repos/PrestaShop/crossselling/commits{/sha}","git_commits_url":"https://api.github.com/repos/PrestaShop/crossselling/git/commits{/sha}","comments_url":"https://api.github.com/repos/PrestaShop/crossselling/comments{/number}","issue_comment_url":"https://api.github.com/repos/PrestaShop/crossselling/issues/comments{/number}","contents_url":"https://api.github.com/repos/PrestaShop/crossselling/contents/{+path}","compare_url":"https://api.github.com/repos/PrestaShop/crossselling/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PrestaShop/crossselling/merges","archive_url":"https://api.github.com/repos/PrestaShop/crossselling/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PrestaShop/crossselling/downloads","issues_url":"https://api.github.com/repos/PrestaShop/crossselling/issues{/number}","pulls_url":"https://api.github.com/repos/PrestaShop/crossselling/pulls{/number}","milestones_url":"https://api.github.com/repos/PrestaShop/crossselling/milestones{/number}","notifications_url":"https://api.github.com/repos/PrestaShop/crossselling/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PrestaShop/crossselling/labels{/name}","releases_url":"https://api.github.com/repos/PrestaShop/crossselling/releases{/id}","created_at":"2014-03-20T13:17:05Z","updated_at":"2015-04-29T14:55:28Z","pushed_at":"2015-07-20T12:10:58Z","git_url":"git://github.com/PrestaShop/crossselling.git","ssh_url":"git@github.com:PrestaShop/crossselling.git","clone_url":"https://github.com/PrestaShop/crossselling.git","svn_url":"https://github.com/PrestaShop/crossselling","homepage":"http://www.prestashop.com","size":304,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":3,"forks":9,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/PrestaShop/crossselling/pulls/11"},"html":{"href":"https://github.com/PrestaShop/crossselling/pull/11"},"issue":{"href":"https://api.github.com/repos/PrestaShop/crossselling/issues/11"},"comments":{"href":"https://api.github.com/repos/PrestaShop/crossselling/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/PrestaShop/crossselling/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/PrestaShop/crossselling/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PrestaShop/crossselling/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/PrestaShop/crossselling/statuses/3cd913dccf33a721a0609b0034aea340c7a4d518"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":4,"additions":90,"deletions":157,"changed_files":1}}