1. czombos
  2. RO CSVI
  3. Wednesday, 21 May 2025
  4.  Subscribe via email
Hi,

We are experiencing inconsistent behavior with the VirtueMart category import/export functionality in RO CSVI.

The currently installed Joomla! version is 4.3.4
The currently installed RO CSVI and VM addon is 8.18.1
The currently installed VirtueMart 4.4.4 11101

Problem:
During category exports, the parent category (e.g., “Brand/”) is sometimes missing from the category_path field, even though


  • The category is properly nested under its parent in the VirtueMart backend.

  • The structure is visible and correct when browsing the categories in the admin panel or on the frontend.

    No recent changes were made to these entries manually.

    Re-importing the same exported file sometimes duplicates categories or places them at the root level instead of under the intended parent, even when using the "virtuemart_category_id".


What we noticed:
In the exported file, some entries have the full path like Brand/Arezzo Design, but others that are clearly nested do not contain the parent (Brand/) at all — even though they are correctly nested in the backend.

If we manually add the missing parent path to the category_path column before import, everything works fine.

Steps we've taken:

  • Reverted database to earlier state and re-exported — same issue.

  • Verified CSVI is up to date.

    Tried both CSV and XLSX format – same results.


I have attached a log file of the export, and one line from the export that should have the Brand ("Márka" in Hungarian) in the Category path.

You can see it on the attached screenshot that the category ID is the same in the spreadsheet and in the VM Admin for that category, and it is nested in the "Márka" category.

(I know, we use Brand as a Category, that's another story)

Can you please advise:

Why does the category_path sometimes omit the parent category during export?

Is there a known bug or setting that affects the hierarchy resolution during export?

Is there a workaround to ensure the full path is always included?

Thanks in advance for your support!

Best regards,
Attila Czombos
Attachments (3)
Accepted Answer
Accepted Answer Pending Moderation
Hi Tharuna,

Thank you very much for pointing me in the right direction and ultimately to the solution.

Here are the steps taken so that all parent and child categories are now correctly stored in the DB, therefore exporting correctly:

Select the duplicated category child IDs


SELECT *
FROM invict4_virtuemart_category_categories
WHERE category_child_id IN (
SELECT category_child_id
FROM invict4_virtuemart_category_categories
GROUP BY category_child_id
HAVING COUNT(*) > 1
)
ORDER BY category_child_id;


From these duplicates select only where category_parent_id = 0


SELECT *
FROM invict4_virtuemart_category_categories
WHERE category_child_id IN (
SELECT category_child_id
FROM invict4_virtuemart_category_categories
GROUP BY category_child_id
HAVING COUNT(*) > 1
)
AND category_parent_id = 0
ORDER BY category_child_id, id;



DELETE cat_cat
FROM invict4_virtuemart_category_categories AS cat_cat
JOIN (
SELECT category_child_id
FROM invict4_virtuemart_category_categories
GROUP BY category_child_id
HAVING COUNT(*) > 1
) AS dupes
ON cat_cat.category_child_id = dupes.category_child_id
WHERE cat_cat.category_parent_id = 0;


To update category_parent_id in the invict4_virtuemart_category_categories table by matching category_child_id with virtuemart_category_id from the invict4_virtuemart_categories table



SELECT
cat_cat.id,
cat_cat.category_child_id,
cat_cat.category_parent_id AS current_parent_id,
cat.category_parent_id AS new_parent_id
FROM invict4_virtuemart_category_categories AS cat_cat
JOIN invict4_virtuemart_categories AS cat
ON cat_cat.category_child_id = cat.virtuemart_category_id
WHERE cat_cat.category_parent_id = 0;



UPDATE invict4_virtuemart_category_categories AS cat_cat
JOIN invict4_virtuemart_categories AS cat
ON cat_cat.category_child_id = cat.virtuemart_category_id
SET cat_cat.category_parent_id = cat.category_parent_id
WHERE cat_cat.category_parent_id = 0;


Thank you again.
Awesome Support.
Sorry, the discussion is currently locked. You will not be able to post a reply or a comment at the moment.