shankscomp Posted April 8, 2009 Posted April 8, 2009 trying to find a mod so I can assign dates to items to automatically become inactive. Any ideas? For example, product XYZ will become inactive on May 1 2009. Thanks Tim
jonathanm Posted April 8, 2009 Posted April 8, 2009 Wow, judging by the ages of and responses to (or lack thereof) some of these thread below, my guess is that no one has built such a contribution because it's too difficult. http://www.oscommerce.com/forums/index.php?sho...c=63013&hl= http://www.oscommerce.com/forums/index.php?sho...=262830&hl= I don't mind hacking my way through it; I'm an experienced C++, Perl, etc. programmer, but I'm new to PHP, and not very familiar with the OSCommerce infrastructure. Anyone have an idea of a rough number of php files I'd have to mod to add the query statement needed (after the field has been added to MySQL and the admin page has been updated)?
MrPhil Posted April 9, 2009 Posted April 9, 2009 I suppose you could add a new field to a product listing, containing an expiration date, but I don't like global data modifications triggered when someone accesses a product, nor do I like the idea of dead products cluttering up the system. I think the best solution would be to build an external utility in PHP that reads a flat file list of product IDs and expiration dates. Fire it off once a day from cron to go into the database (and image files) and remove product(s). It might be able to borrow a lot of code from admin section's product deletion functions. The store owner/admin would have to go through once in a while and update the flat file list to remove now-dead items, so the utility shouldn't get upset if it reads the list and finds it has already deleted the product (with appropriate coding, it might even be possible to delete it from the list too). If one can do this to delete products on a schedule, it might be possible to do something similar to add products on a schedule, or change product information (e.g., sale prices) on schedule. Does osC have a command line interface to do such operations (one at a time)? If so, you could simply fire it off on a cron job scheduler. Such a generalized function might be worth looking into.
jonathanm Posted April 9, 2009 Posted April 9, 2009 Thanks for the reply, Phil. I suppose you could add a new field to a product listing, containing an expiration date, but I don't like global data modifications triggered when someone accesses a product, nor do I like the idea of dead products cluttering up the system. I'm not too concerned about dead products cluttering the product master file. That's actually typical in larger business systems as it is bad accounting practice to delete item master data, since historical sales and shipping data reference the item master. So there is benefit to having an expired product stick around in the item master file. Typically the item master will have a field that indicates the date the item is no longer available. At the very least, another file could be created to hold expired items if there's a concern that query retrieval times will balloon with a bunch of dead products in the dead products file. The challenge there, though, is that the expired products file will be referencing attribute data (and maybe category data?) from the "live" files. Does anyone have an estimate of how many product queries I would need to modify to make it screen out expired product if an expiry field were added? More than a dozen? A couple? Anyone know?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.