Support is online

Unpublish categories in VirtueMart #8338

Open gibilogic opened this topic Tuesday, 14 June 2016 · 2 replies
Author

Hello!

This is VirtueMart 3.0.16 on Joomla 3.5.1 and CSVI 5.21.2.

I have a scheduled daily import of products, and I have been made a specific request: after product import, all empty categories should be unpublished.

The only way I can think of is to do a "Category Import" with the "published" field set to 0, but that requires a bit of work (export all existing categories, compare with current product list, generate a new csv file for categories, import that csv).

Before I spend time on it, I'd like to know if there is a better / quicker way do to it in CSVI

Thank you and have a nice day!

Support

Hello,

If you can remove the empty categories, you could run a cron job for the maintenance menu to remove the empty categories. If you only need to unpublish them then I would say you could do the following. First run a job with an SQL query that sets all categories to unpublished. Second run an export of product_sku and category_path using the Product export. Third run a category import using this same file, no changes needed, and add the fields to template (don't use file for configuration). Set the product_sku field to skip, category_path is category_path and add a third field called published with a default value of Y.

After this you should only have categories published that have products in them without manual intervention. Just a few jobs to run.

Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory

Author

Thank you! I did not know about the "maintenance" task. I would prefer to unpublish the categories, but it's probably much simpler to run that single task instead of the multiple jobs you described.

Log in to reply to this topic.