Serveur preprod f0c0c48223 first push
2016-04-14 16:14:31 +02:00

21 lines
616 B
PHP

<?php
include(dirname(__FILE__).'/../../config/config.inc.php');
/* Check to security tocken http://www.privilegedemarque.com/modules/privatesales/cron.php?token=RTjIh8fhIK25 */
if (!Tools::getValue('token')) {
die('Bad token');
}
include(dirname(__FILE__).'/privatesales.php');
$sales = SaleCore::getSales('all', 0, true, false);
foreach ($sales as $key => $sale) {
$products = $sale->getProducts();
foreach ($products as $p) {
Db::getInstance()->Execute('
INSERT IGNORE INTO '._DB_PREFIX_.'product_ps_cache (id_product,id_sale)
VALUES ('.(int)$p.','.(int)$sale->id_privatesales.')
');
}
}
exit;