Ok...I'm running PHP 5.6 and MySQL 5.5.49-0+deb7u1.
We are a wholesale company and allow some of our customers to become distributors.
When I add new products to our site it does automatically update our client sites BUT the price does NOT reflect their Retail pricing. Is the value they use for Global Price change able to be stored so I can amend the SQL call to apply that to new products coming over?
I would prefer to not have to update all my client sites prices when I add new products.
I've asked the guy who created the site about add-ons or plugins and he says we only have the shipping and order mods.
Here is the piece of code that updates our client sites off of our DB:
PHP Code:
/* -MDC bof update products table with ***** values if not done in last 12 hours */
$sql_date = $db->Execute("SELECT products_last_modified FROM " . TABLE_PRODUCTS . " WHERE 1 ORDER BY RAND() LIMIT 1;");
$date = strtotime($sql_date->fields['products_last_modified']);
if(($date + 43200) < time())
{
$update_sql = "INSERT INTO products SELECT * FROM mydatabase.products
ON DUPLICATE KEY UPDATE
products_price_w=VALUES(products_price),
products_status=VALUES(products_status),
products_last_modified=NOW();";
$db->Execute($update_sql);
}
/* -MDC eof */
I am REALLY new at the MySql and PHP but I am a fast learner.
I'm assuming the global price changer
Is just a piece of SQL code that looks something like this: UPDATE products SET products_price=products_price_w*MARKUP
I'm just now starting to dig into where all the pages are stored for our sites.
Thanks in Advance
tmpinsnty
Bookmarks