I need to export all of my products along with each category they belong to. The two tricks here are:
So one category for a product might be food/fruit/rasberry and I want all three of these as one of its categories, not just 'rasberry'.
Ideally I want a sixcolumn csv that gives me the sku, the product name, and 4 columns for categories.
Any extentions that do this? Or suggestions for a simple way to do it?
Thanks!
Thanks Melvyn,
We have no plans to change the format. I am not sure what this code would look like. Any pointers?
The easiest way to get the category data is from the category flat table. However, it's still not trivial. If you want a solution, you can build on the Free CSV Product Export Script for Magento 2.x. In addition to SKU and Name, it exports a field called json_categories, which contains all the category data for each item in this format (formatted for readability):
[
["2","1\/2","Default Category"],
["21","1\/2\/20\/21","Tops"],
["23","1\/2\/20\/21\/23","Jackets"],
["30","1\/2\/29\/30","Women Sale"]
]
You would still have to parse the JSON and reformat.
If you want that data formatted like this:
Default Category > Tops > Jackets,Default Category > Women Sale
then you can set up a Google feed at Aten Software using the free trial and add the aten_all_product_categories field to the feed. That column will contain all four categories separated by commas.