{"action":"opened","issue":{"url":"https://api.github.com/repos/EmicoEcommerce/Magento2Tweakwise/issues/51","repository_url":"https://api.github.com/repos/EmicoEcommerce/Magento2Tweakwise","labels_url":"https://api.github.com/repos/EmicoEcommerce/Magento2Tweakwise/issues/51/labels{/name}","comments_url":"https://api.github.com/repos/EmicoEcommerce/Magento2Tweakwise/issues/51/comments","events_url":"https://api.github.com/repos/EmicoEcommerce/Magento2Tweakwise/issues/51/events","html_url":"https://github.com/EmicoEcommerce/Magento2Tweakwise/issues/51","id":359012704,"node_id":"MDU6SXNzdWUzNTkwMTI3MDQ=","number":51,"title":"Grouped template items not showing","user":{"login":"govereem","id":1452149,"node_id":"MDQ6VXNlcjE0NTIxNDk=","avatar_url":"https://avatars0.githubusercontent.com/u/1452149?v=4","gravatar_id":"","url":"https://api.github.com/users/govereem","html_url":"https://github.com/govereem","followers_url":"https://api.github.com/users/govereem/followers","following_url":"https://api.github.com/users/govereem/following{/other_user}","gists_url":"https://api.github.com/users/govereem/gists{/gist_id}","starred_url":"https://api.github.com/users/govereem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/govereem/subscriptions","organizations_url":"https://api.github.com/users/govereem/orgs","repos_url":"https://api.github.com/users/govereem/repos","events_url":"https://api.github.com/users/govereem/events{/privacy}","received_events_url":"https://api.github.com/users/govereem/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-11T11:56:16Z","updated_at":"2018-09-11T11:56:16Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I think tweakwise changed the result given and changed the xml structure.\r\nvendor/emico/tweakwise/src/Model/Client.php function doRequest returns the wrong array structure after xmlToArray. The upsell / crosssell collection expects an array return from doRequest items->item[]\r\nBut will return recommendation->items->item[], the collection will have no records.\r\n\r\nURL: http://navigator-group1.tweakwise.com/recommendations/grouped/..../...../groupname\r\n\r\nMagento 2.2.4\r\nTweakwise Version 1.3.2\r\nphp 7.1\r\n\r\nFor now fixed it with a dirty solution\r\nIn the doRequest added to the and before $this->responseFactory->create($request, $result);\r\n```\r\n        if(isset($result['recommendation'])) {\r\n            $updatedResult=[];\r\n            foreach($result['recommendation'] as $key => $items) {\r\n                foreach($items['items'] as $itemArr) {\r\n                    if(isset($itemArr['itemno'])) {\r\n                        $updatedResult['items']['item'][] = $itemArr;\r\n                    } else {\r\n                        foreach($itemArr as $item) {\r\n                            $updatedResult['items']['item'][] = $item;\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n            return $this->responseFactory->create($request, $updatedResult);\r\n        }\r\n```\r\n\r\nResult grouped:\r\n```\r\n<recommendations xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\">\r\n<recommendation>\r\n<id>12</id>\r\n<name>Upsell / Cirkelzagen (Spanklemmen)</name>\r\n<items>\r\n<item>\r\n<itemno>1000171667</itemno>\r\n<title>Festool SYS-MFT Fixing-Set Limited Edition</title>\r\n<brand/>\r\n<price>247.89</price>\r\n<url i:nil=\"true\"/>\r\n<image i:nil=\"true\"/>\r\n<labels i:nil=\"true\"/>\r\n<attributes/>\r\n</item>\r\n<item>\r\n<itemno>1000154653</itemno>\r\n<title>Festool FS-HZ 160 Snelspanklem 491594</title>\r\n<brand/>\r\n<price>41.28</price>\r\n<url i:nil=\"true\"/>\r\n<image i:nil=\"true\"/>\r\n<labels i:nil=\"true\"/>\r\n<attributes/>\r\n</item>\r\n</items>\r\n</recommendation>\r\n<recommendation>\r\n<id>421</id>\r\n<name>Upsell / Cirkelzagen (Foudraals) </name>\r\n<items>\r\n<item>\r\n<itemno>1000154650</itemno>\r\n<title>Festool FS-BAG Foudraal 466357</title>\r\n<brand/>\r\n<price>47.89</price>\r\n<url i:nil=\"true\"/>\r\n<image i:nil=\"true\"/>\r\n<labels i:nil=\"true\"/>\r\n<attributes/>\r\n</item>\r\n</items>\r\n</recommendation>\r\n<recommendation>\r\n<id>422</id>\r\n<name>Upsell / Cirkelzagen (Parallelaanslagen)</name>\r\n<items>\r\n<item>\r\n<itemno>1000154086</itemno>\r\n<title>Festool FS-PS/PSB 300 Geleideaanslag 490031</title>\r\n<brand/>\r\n<price>12.355</price>\r\n<url i:nil=\"true\"/>\r\n<image i:nil=\"true\"/>\r\n<labels i:nil=\"true\"/>\r\n<attributes/>\r\n</item>\r\n</items>\r\n</recommendation>\r\n</recommendations>\r\n```\r\nResult product template (That works!):\r\n```\r\nThis XML file does not appear to have any style information associated with it. The document tree is shown below.\r\n<recommendation xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\">\r\n<items>\r\n<item>\r\n<itemno>1000153649</itemno>\r\n<title>\r\nFestool Speciaal Cirkelzaagblad 160x2,2x20 TF48 496308\r\n</title>\r\n<brand/>\r\n<price>61.94</price>\r\n<url i:nil=\"true\"/>\r\n<image i:nil=\"true\"/>\r\n<labels i:nil=\"true\"/>\r\n<attributes/>\r\n</item>\r\n<item>\r\n<itemno>1000167623</itemno>\r\n<title>\r\nFestool Diamant Cirkelzaagblad 160x2,2x20 DIA4 201910\r\n</title>\r\n<brand/>\r\n<price>123.925</price>\r\n<url i:nil=\"true\"/>\r\n<image i:nil=\"true\"/>\r\n<labels i:nil=\"true\"/>\r\n<attributes/>\r\n</item>\r\n<item>\r\n<itemno>1000153653</itemno>\r\n<title>\r\nFestool Fijngetand Cirkelzaagblad 160x2,2x20 W48 491952\r\n</title>\r\n<brand/>\r\n<price>41.28</price>\r\n<url i:nil=\"true\"/>\r\n<image i:nil=\"true\"/>\r\n<labels i:nil=\"true\"/>\r\n<attributes/>\r\n</item>\r\n<item>\r\n<itemno>1000153650</itemno>\r\n<title>\r\nFestool Speciaal Cirkelzaagblad 160x2,2x20 TF48 496306\r\n</title>\r\n<brand/>\r\n<price>68.553</price>\r\n<url i:nil=\"true\"/>\r\n<image i:nil=\"true\"/>\r\n<labels i:nil=\"true\"/>\r\n<attributes/>\r\n</item>\r\n<item>\r\n<itemno>1000153652</itemno>\r\n<title>\r\nFestool Universeel Cirkelzaagblad 160x2,2x20 W28 496302\r\n</title>\r\n<brand/>\r\n<price>37.15</price>\r\n<url i:nil=\"true\"/>\r\n<image i:nil=\"true\"/>\r\n<labels i:nil=\"true\"/>\r\n<attributes/>\r\n</item>\r\n<item>\r\n<itemno>1000153651</itemno>\r\n<title>\r\nFestool Standaard Cirkelzaagblad 160x2,2x20 W18 768129\r\n</title>\r\n<brand/>\r\n<price>30.537</price>\r\n<url i:nil=\"true\"/>\r\n<image i:nil=\"true\"/>\r\n<labels i:nil=\"true\"/>\r\n<attributes/>\r\n</item>\r\n<item>\r\n<itemno>1000163955</itemno>\r\n<title>\r\nFestool Panther Cirkelzaagblad 160x1,8x20 PW12 500460\r\n</title>\r\n<brand/>\r\n<price>45.41</price>\r\n<url i:nil=\"true\"/>\r\n<image i:nil=\"true\"/>\r\n<labels i:nil=\"true\"/>\r\n<attributes/>\r\n</item>\r\n<item>\r\n<itemno>1000163954</itemno>\r\n<title>\r\nFestool Standaard Cirkelzaagblad 160x1,8x20 W18 500458\r\n</title>\r\n<brand/>\r\n<price>33.016</price>\r\n<url i:nil=\"true\"/>\r\n<image i:nil=\"true\"/>\r\n<labels i:nil=\"true\"/>\r\n<attributes/>\r\n</item>\r\n</items>\r\n</recommendation>\r\n```\r\n"}}
{"actor":{"display_login":"govereem"}}