magicjebb Posted July 26, 2010 Posted July 26, 2010 The description is self-explanatory enough: I want my Easy Populate updates to remove ENTIRELY from the database items that I don't have in stock anymore (v_products_quantity = 0) I have an osCommerce with Easy Populate and TONS of items that take a LOT to show when browsing categories, and I discovered if I remove MANY of my items from the catalog, the shop goes a lot faster. The idea is to use Easy Populate to remove items not in stock from the database (including comments and stuff) whenever I update the shop with it. It is possible? If so, which lines I have to change/add from the code? -- Fabian Balbinot
rocaholic Posted July 26, 2010 Posted July 26, 2010 I would like to know this as well. I have been manually deleting products through the oscommerce admin but this takes a long time for a store with 25,000+ products! Bump!
NodsDorf Posted July 26, 2010 Posted July 26, 2010 You can remove them from the database directly with an SQL statement. DELETE FROM `products` WHERE products_quantity = '0' This will get them out of the products table and prevent them from loading in the categories. However, this will not delete the external table references to them, such as product descriptions, reviews or any other add-on that would reference the product by its product_id. To do that you would need to grab all the product_ids and then remove the references in all the other tables to that product_id. Example table product_descriptions table reviews both have references to them. You could use excel to make a quick multi delete statement after you have the product ids to run in each one of these tables. As for how or if easy populate can do it, that I don't know. I always use Store Manager for import and export so not much experience with it. Also since this is an SQL statement once you run it, its final so make a back up if you attempt to use SQL direct methods.
♥geoffreywalton Posted July 26, 2010 Posted July 26, 2010 Or you could set the status to inactive if the stock level is zero. Or you could use EP to delete the product. The later versions allow you to set the status. //**** Status Field Setting **** // Set the v_status field to "Inactive" if you want the status=0 in the system define ('EP_TEXT_ACTIVE', 'Active'); define ('EP_TEXT_INACTIVE', 'Inactive'); // Set the v_status field to "Delete" if you want to remove the item from the system define ('EP_DELETE_IT', 'Delete'); I do wish people would read the documentation, EP can do so many things. :-) G Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile Virus Threat Scanner My Contributions Basic install answers. Click here for Contributions / Add Ons. UK your site. Site Move. Basic design info. For links mentioned in old answers that are no longer here follow this link Useful Threads. If this post was useful, click the Like This button over there ======>>>>>.
magicjebb Posted July 26, 2010 Author Posted July 26, 2010 I do wish people would read the documentation, EP can do so many things. :-) I do wish I had time to read documentation... =P Thanks for the hint, anyway. I'll check the new EP releases and try to update mine ASAP. -- Fabian Balbinot
magicjebb Posted July 27, 2010 Author Posted July 27, 2010 Nice. But NOT nice at all. I went through the new releases of EP at http://www.oscommerce.com/community/contributions,500 and while the new ones have THE HECK of extra stuff that I... (1)don't need; (2)don't have time to deal with; (3)I'm EVEN afraid of trying to use... most of the old ones have that problem of "$deleteit = 'Delete'; // not functional yet". I'm using version 2.74 MS2 since before the dinos were extinct, and due to personal and profissional reasons I do not want to do major mods in my shop. Is there an EASY way to implement this DELETE function in this version I'm using? Also... You can remove them from the database directly with an SQL statement. DELETE FROM `products` WHERE products_quantity = '0' What other stuff should I add to this code to remove even the product descriptions and reviews from my db? Just in case my prior question ends unanswered... =P Thanks. -- Fabian Balbinot
♥geoffreywalton Posted July 27, 2010 Posted July 27, 2010 The quote above came from Easy Populate 2.76f-MS2 r1 It would be easier to install that version than add functionality to an older contribution. Cheers G Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile Virus Threat Scanner My Contributions Basic install answers. Click here for Contributions / Add Ons. UK your site. Site Move. Basic design info. For links mentioned in old answers that are no longer here follow this link Useful Threads. If this post was useful, click the Like This button over there ======>>>>>.
magicjebb Posted July 27, 2010 Author Posted July 27, 2010 Done changing to Ep 2.76f-MS2 r1. I even made a duplicate of my database in order to avoid any crashes :) Problem is I can't edit the csv file and didn't find any way to export EP files in TXT format, even though one of the sample_output_files is TXT. CSV files show products and stuff in an unfriendly way, nearly impossible to edit, and even changing it to TXT doesn't do any change in the file contents. How can I make the EP generate TXT files instead of these CSV? -- Fabian Balbinot
magicjebb Posted July 27, 2010 Author Posted July 27, 2010 Forgeting about this new EP thing - I'm rolling back to my previous version... don't have time to waste with all changes this new version offers - isn't there an simple way to extend the MySQL code shown above... DELETE FROM `products` WHERE products_quantity = '0' ... and tell it to delete from `products`, `products_description`, `products_notifications` and `products_to_categories` (and also in `reviews` and `reviews_description` if possible) all items that in `products` have products_quantity = '0'? Thanks. -- Fabian Balbinot
lindsayanng Posted July 28, 2010 Posted July 28, 2010 CSV is hardly unfriendly and hard to read.. if you have a spreadsheet program like excel you should have no issues at all looking at very neatly organized tables of product information. I have had absolutely no products updating and editing my products by the THOUSANDS on a weekly basis using Easy Populate.. I love how you "don't have the time" to put into your own store.. but you have the time to come here and wait around for others to help you with THEIR time.. My suggestion is to take the time to install EP properly and then open it in a program that deals with CSV files and you will have no issues. A great place for newbies to start Road Map to oscommerce File Structure DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways! HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you Proud Memeber of the CODE BREAKERS CLUB!!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.