Page 1 of 1

How to link products to all categories easly ?

Posted: Wed Jan 04, 2017 5:35 pm
by scracingshop
Hello all,
i'm Italian, sorry if my english isn't perfect.
I'm using Opencart 2.3.0.2 and i have near 300 Categories/subcategories in my store. When i create a Product that i call "universal" i have to Select in "LINK" all 300 Categories/subcategories manually and by autocomplete (very slowly and noisy).
There is a metod to select only "Main Category" (and automatically will show to all subcategories) or something module or modification of file that can me help (like select all.. etc) ?

Thanks a lot,
kind regards
Riccardo

Re: How to link products to all categories easly ?

Posted: Wed Jan 04, 2017 5:38 pm
by paulfeakins
Hi Riccardo,

I don't think there is a way to do it without a module or something, but can I ask what are the categories and why do you want a product to appear in all?

Cheers,
Paul

Re: How to link products to all categories easly ?

Posted: Wed Jan 04, 2017 5:43 pm
by scracingshop
paulfeakins wrote:Hi Riccardo,

I don't think there is a way to do it without a module or something, but can I ask what are the categories and why do you want a product to appear in all?

Cheers,
Paul
Hi Paul,
thanks for your fast reply.
I have 300 types of Moto sorted by Manufacter (like Honda) and in subcategory all models (like CBR1000R etc). So i have a lot of product to link to all Models of moto.

I have seen a Post in this forum but for 1x version.. they said to do:

Code: Select all

Go to catalog/controller/product/category.php

Find 'filter_category_id' => $category_id, and add this line 'filter_sub_category' => true, . Now it shows the all subcategory products when you access category name. I hope this answer will help anyone here..
But i tryed to do and this don't work in 2x i think :/

Re: How to link products to all categories easly ?

Posted: Wed Jan 04, 2017 10:17 pm
by IP_CAM
are you looking for something like this ?
Disable Autocomplete
This mod disable the browser auto-complete function in the product form (add and edit).
https://www.opencart.com/index.php?rout ... n_id=20490
Ernie

Re: How to link products to all categories easly ?

Posted: Thu Jan 05, 2017 5:21 pm
by scracingshop
IP_CAM wrote:are you looking for something like this ?
Disable Autocomplete
This mod disable the browser auto-complete function in the product form (add and edit).
https://www.opencart.com/index.php?rout ... n_id=20490
Ernie
Yes exactly! It works for my Version of oc? I have the last..

Thanks!

Re: How to link products to all categories easly ?

Posted: Tue Jan 17, 2017 8:22 am
by scracingshop
up pls.. not solved

Re: How to link products to all categories easly ?

Posted: Tue Jan 17, 2017 5:48 pm
by thekrotek
There's no simple solution for this and disabling autocomplete will not help you. One way or another you need to define categories you want to assign to product. If you want some custom behavior here, your only option is to do custom coding.

Re: How to link products to all categories easly ?

Posted: Tue Jan 17, 2017 7:16 pm
by chulcha
1 backup
2 backup

3.

Code: Select all

DELETE FROM oc_product_to_category WHERE product_id= 'YOUR uneversal_product_id';
INSERT INTO oc_product_to_category VALUES(prosuct_id,category_id) (SELECT 'YOUR uneversal_product_id', category_id FROM oc_category);