luke.c21hygiene Posted August 2, 2016 Share Posted August 2, 2016 Hello, I'm after some help with removing products from the popular products page on the home page of our shop. Basically I have added a bunch of products to the website and it added them all to the popular products page by default. Is there a way to completely remove all the products from the popular page so I can start fresh instead of manually going into each product and doing them individually. Thanks Link to comment Share on other sites More sharing options...
rocky Posted August 2, 2016 Share Posted August 2, 2016 You'll need to log in to phpMyAdmin through your cPanel and execute an SQL query to update the categories of all products. Go to the ps_category_lang table and check the ID of the "Home" category. It should be 3, but it may be 2 in some cases. If all the products are in other categories including the "Home" category, you can remove them from the "Home" category using the following SQL query: DELETE FROM `ps_category_product` WHERE `id_category` = 3 Change ps_ to your database prefix and 3 to 2 if needed. If all the products are only in the "Home" category and no other category, you can use the following SQL query to move them to another category: UPDATE `ps_category_product` SET `id_category` = 4 WHERE `id_category` = 3 Change ps_ to your database prefix and 3 to 2 if needed. Link to comment Share on other sites More sharing options...
luke.c21hygiene Posted August 3, 2016 Author Share Posted August 3, 2016 You'll need to log in to phpMyAdmin through your cPanel and execute an SQL query to update the categories of all products. Go to the ps_category_lang table and check the ID of the "Home" category. It should be 3, but it may be 2 in some cases. If all the products are in other categories including the "Home" category, you can remove them from the "Home" category using the following SQL query: DELETE FROM `ps_category_product` WHERE `id_category` = 3 Change ps_ to your database prefix and 3 to 2 if needed. If all the products are only in the "Home" category and no other category, you can use the following SQL query to move them to another category: UPDATE `ps_category_product` SET `id_category` = 4 WHERE `id_category` = 3 Change ps_ to your database prefix and 3 to 2 if needed. Thanks for getting back to me Rocky. Is there anyway i can backup before i do this just as a safety measure. Also, im not 100% on the prefix part, i thin i have found it, its just the name of the data base correct? Do i put the name of the database before the ps_ or do i delete the ps_ and replace it with the database name? could you give me an example of what the string would looklike with a database prefix in? as you can tell, i dont use php thanks again! Link to comment Share on other sites More sharing options...
rocky Posted August 4, 2016 Share Posted August 4, 2016 The database prefix is usually ps_ unless you specifically entering another one during installation. Note that I mean the prefix before each of the table names, not the database itself. There is no need to include the database name in the SQL query as long as you've selected the appropriate database in phpMyAdmin. You can just copy and paste the queries above. You can export the table before modifying it by clicking on the ps_category_product table and then clicking the Export tab. If something goes wrong, you can empty the table and then click the Import tab and upload the file you exported. Link to comment Share on other sites More sharing options...
luke.c21hygiene Posted August 4, 2016 Author Share Posted August 4, 2016 The database prefix is usually ps_ unless you specifically entering another one during installation. Note that I mean the prefix before each of the table names, not the database itself. There is no need to include the database name in the SQL query as long as you've selected the appropriate database in phpMyAdmin. You can just copy and paste the queries above. You can export the table before modifying it by clicking on the ps_category_product table and then clicking the Export tab. If something goes wrong, you can empty the table and then click the Import tab and upload the file you exported. Ah okay, got ya. Well i have exported the table like you suggested, thanks for that but when i ran the code (i changed the id from 3 to 2) it didn't remove anything from the popular products on the home page. Im sure you know but its just for clarification, when ever i add any new product it is added it to the popular products tab on the home page by default (think its the Shop association). Looking at the table, both the Shop and Home category both have an id_category = 2 will this be causing an issue? Link to comment Share on other sites More sharing options...
rocky Posted August 5, 2016 Share Posted August 5, 2016 Strange. It should work if you have the "Home" category ID correct. Maybe the old categories are cached. Try going to Advanced Parameters > Performance and then clicking the "Clear cache" button. Yes, when you add a product, the "Home" category is ticked by default and the "Default category" is set to "Home". Unless you untick "Home", it will remain as the default category even if you select other categories. You need to remember to untick "Home" after you've finished selecting your categories, then the "Default category" will automatically change to the first selected category, though you can use the dropdown to choose any of the selected categories. Link to comment Share on other sites More sharing options...
luke.c21hygiene Posted August 5, 2016 Author Share Posted August 5, 2016 I managed to do it! turns out the database that it says its using in Softaculous isn't the one in myPHP, i tried the query on a few others and it finally worked! thanks for all your help Rocky 1 Link to comment Share on other sites More sharing options...
rocky Posted August 5, 2016 Share Posted August 5, 2016 You're welcome. I'm happy you figured it out. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now