"Apply values to all selected products" + Secondary Categories

I’d like to use “Apply values to all selected products” to add Secondary Categories to products. The problem is that this functionality deletes any Secondary Categories that the products may already have assigned to them. Does anyone have a solution?



I managed to solve this one on my own. It’s a simple hack, but took a but of digging to find. The following applies to 2.0.12 and probably earlier versions as well.

In /controllers/admin/products.php find (around line 319)

```php db_query(“DELETE FROM ?:products_categories WHERE product_id = ?i AND link_type = ‘A’”, $p_id); ```

and replace with

```php //db_query(“DELETE FROM ?:products_categories WHERE product_id = ?i AND link_type = ‘A’”, $p_id); ```

This will append all “Secondary categories” added to a product when using “Apply values to all selected products” in the admin - preserving existing Secondary categories.

Learn more about that functionality here: [url]CS-Cart Documentation — CS-Cart 4.15.x documentation



Thanks for sharing!!! This has bothered me as well. I’ll have to try this.

Thanks, I did this tweak myself with 1.35 and have yet to do it on version 2.

Thanks again saved me some time.