Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product Status - Inactive


chris2006

Recommended Posts

the only way that I have really found is to get all of the products_model numbers and put them in a text file, then loop through the text file and query the database accordingly for each.

 

#!/bin/bash
INFILE="products_to_inactivate.txt"
cat $INFILE |
while read PRODUCTS_MODEL;
  do 
  {
	   mysql -uusername -ppassword database_name -e "update products set products_status = '0' where products_model = '$PRODUCTS_MODEL'"
  }
done

 

Something along those lines should work, I think. Do some debug and backup your database before you try any of it. To debug, I would suggest creating a small text file with two products in it and running that through the script. Verify that the statuses of those two products change as you would expect (0 or 1). If it works, then you should be in good shape.

 

Good luck!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...