Guest Posted June 11, 2003 Posted June 11, 2003 Does anyone know if there is a contribution or a tip/trick to do this? I have searched the forums to no avail. In particular, we often get limited time specials from our distributors, and it is a pain in the kiester to have to remember to go back in and remove them as they expire. If there were a way for this to happen automatically, it would rock.
LostInPHP Posted June 11, 2003 Posted June 11, 2003 Hi, In your admin, catalog, specials you can set an expiration date. Hope this helps, Terri Help me I'm lost in PHP and I don't have a map!
Guest Posted June 11, 2003 Posted June 11, 2003 Thank you Terri, that is just what I needed. Can't believe I missed that...the older my kids get, the slower I think. You think there is a correlation? :oops:
Guest Posted June 11, 2003 Posted June 11, 2003 In yet another brain f*rt, I realized that this won't QUITE do what I need. I need the products to actually be completely removed from availability once the special expires, like we have a limited number of laptops available on a one-day special price and after today they are no longer available at all.
LostInPHP Posted June 11, 2003 Posted June 11, 2003 Sorry it wasn't exactly what you need. I didn't realize it left the products there. I'd be intersted in this sort of "removing once gone" too as some of my products (handmade soap and toiletries) are made as one time only batches for special customers. Sometimes I have few left over and usually offer them on eBay, but I want to get away from the auction scene because I'm never happy with the money I make there and the eBay market is swapped with handmade soaps. Terri Help me I'm lost in PHP and I don't have a map!
Guest Posted June 11, 2003 Posted June 11, 2003 if you go to includes/functions/specials.php do something like this function tep_expire_specials() { $specials_query = tep_db_query("select specials_id from " . TABLE_SPECIALS . " where status = '1' and now() >= expires_date and expires_date > 0"); if (tep_db_num_rows($specials_query)) { while ($specials = tep_db_fetch_array($specials_query)) { tep_set_specials_status($specials['specials_id'], '0'); tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . $specials['specials_id'] . "'"); } } } which will change the products status to off when the date runs out I haven't tested this BTW
Recommended Posts
Archived
This topic is now archived and is closed to further replies.