Jump to content

Assign Brands and Products


Algra

Recommended Posts

Hi

I would probably do the following 

1) create a category (name it however you want) and make it not visible in front, take note if the category ID (let's say it's 123)

2) run this query (of course, replace 123 by whatever your ID is from the previous point) :

insert into ps_category_product (id_product,id_category) select distinct id_product, 123 as id_category from ps_product where id_manufacturer = '';

(it will put all the products without a brand into this new category)

3) use "filter by category" on the products page of the back office and filter by your last created category, it will show you your products without a brand.

4) when you're done, you can delete your now useless category

Link to comment
Share on other sites

Best method I suggest:

-> Create a new brand and call it something like "Unknown brand". Grab the ID, you will need it on the next step.

-> Navigate to "Advanced Parameters > Database" and add a new query. Replace on the following one "<ID>" with just the id from above (using no quotes or anything).

update ps_product set id_manufacturer = <ID> where id_manufacturer = 0; 

-> Once you have added it, execute it.

Now you can navigate to "Brands & Suppliers" and VIEW from there the associated products, which you can edit and re-assign as required. Whenever new products without a brand are added, they can be either assigned to this "placeholder" brand or the query run again. As soon they are assigned properly to another brand, everything is immediately good, nothing to delete or change.

Link to comment
Share on other sites

1 hour ago, innovacy said:

Best method I suggest:

-> Create a new brand and call it something like "Unknown brand". Grab the ID, you will need it on the next step.

-> Navigate to "Advanced Parameters > Database" and add a new query. Replace on the following one "<ID>" with just the id from above (using no quotes or anything).

update ps_product set id_manufacturer = <ID> where id_manufacturer = 0; 

-> Once you have added it, execute it.

Now you can navigate to "Brands & Suppliers" and VIEW from there the associated products, which you can edit and re-assign as required. Whenever new products without a brand are added, they can be either assigned to this "placeholder" brand or the query run again. As soon they are assigned properly to another brand, everything is immediately good, nothing to delete or change.

Thanks for your answer, when I send the SQL query I get an error ("SELECT" does not exist.) what should I do

Link to comment
Share on other sites

2 hours ago, toup said:

Hi

I would probably do the following 

1) create a category (name it however you want) and make it not visible in front, take note if the category ID (let's say it's 123)

2) run this query (of course, replace 123 by whatever your ID is from the previous point) :

insert into ps_category_product (id_product,id_category) select distinct id_product, 123 as id_category from ps_product where id_manufacturer = '';

(it will put all the products without a brand into this new category)

3) use "filter by category" on the products page of the back office and filter by your last created category, it will show you your products without a brand.

4) when you're done, you can delete your now useless category

Hi, thank you for you answer. When I submit the query I get the following error ("INSERT" is a reserved word. )

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...