Closed MarianNapi closed 10 months ago
Hi @MarianNapi, we only push the complete category paths to Channable, not the actual category name, as this is a requirement from Channable side where we sort them on level. Can you explain what you are trying to accomplish?
So what I try to accomplish is to send a list to channable with category names and paths. And looking into the code I saw, that the attribute 'name' is loaded and given to Source.php but then purged.
I understand that it's not a requirement by Channable - even tho i do not see a reason for that - but then you might want to remove following line:
The parameter 'name' is not needed in the object and will just consume resources.
Channable processes these paths back to categories in their tool. You will see 'categories' and 'category_paths' when you navigate to 'items' on app.channable.com and preview the data.
Hello @MarianNapi , I'm happy to inform you that we've recently released version 1.16.0, with the modification you requested. I'm marking this issue as closed, but please don't hesitate to reopen it if you have any additional questions
So line 845 $category has properties name, level and path. Line 847 implodes path into a new array (why?). Line 851 and onwards sorts the new array by level and returns this new array.
-> Property name is purged.
https://github.com/magmodules/magento2-channable/blob/cdcc4d8d3c1eded2c473c7e5ab0286b60aae4bd8/Helper/Source.php#L843-L858
Expected result:
['categories' => ['name' => 'CategoryName', 'level' => 'CategoryLevel', 'path' => 'Category > Path']]
Result in reality:
['categories' => ['level' => 'CategoryLevel', 'path' => 'Category > Path']]