I have 3 tables:
Product_categories (created from a .csv import). The limit number of categories in subcategories is 4.
product_reference | category_id | subcategories
REF.001 | 1 | 1/2
Categories (created from a .csv import)
id | name
1 | example_category_1
2 | example_category_2
Importer* (created to store all the data I need from the previous tables)
sku | category
REF.001 | null
How could I update Importer to show the following? The limit number of categories in subcategories is 4.
sku | category
REF.001 | example_category_1>example_category_2
*Data in Importer would be to export in .csv and be able to import in WooComerce, this is why I need to import the categories by this way. https://docs.woocommerce.com/document/product-csv-import-suite-column-header-reference/#section-4
Best Answer
Full example.
1) Create tables and data (code)
2) Check data (console output)
3) Perform update (code)
4) Check result (console output)