Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How can I mark everything in catalog 30% off


Guest

Recommended Posts

Thanks in advance.

 

I am looking for a way to mark everything 30% off with an expiry date.

 

I am currently using the specials.php in the admin to accomplish this, With a large product base this is going to take a long time.

 

Anyone have any thoughts on this?

Link to comment
Share on other sites

you can do this easily in your SQL database.

 

simply extract all the products id out from your products table, edit with notepad to confer with your specials table, and run "insert into" SQL statements into your specials table (preferably using phpmyadmin).

Link to comment
Share on other sites

Hey Al. Here ya go.

 

Copy this php code and place it in your admin folder. Then simply change the expiration date from the code to whatever day you want, and run the code.

 

Copy the output and then place it into phpMyAdmin under the SQL tab. All done.

 

HTH,

-Chris

 

<?php

require('includes/application_top.php');

$expiration_date = '2003-12-17 18:32:54';

$products_query = tep_db_query('select products_id, (products_price * .70) as special_price from ' . TABLE_PRODUCTS . ' order  by products_id asc');
while ($products = tep_db_fetch_array($products_query)) {

echo "INSERT INTO `specials` ( `specials_id` , `products_id` , `specials_new_products_price` , `specials_date_added` , `specials_last_modified` , `expires_date` , `date_status_change` , `status` ) 
VALUES (
'', '" . $products['products_id'] . "', '" . $products['special_price'] . "', 'now()', 'now()', '" . $expiration_date . "', 'now()', '1'
);<br>";
}

?>

Chris Sullivan

Link to comment
Share on other sites

not sure either, just no mail,

Hey Chris, this would make a great contribution if all the details were worked out, Admin would just tnere the discount amount, program does the rest.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...