/** * @param $update_array array if the IDs of the available methods, * all other methods will be set to 'not available' */ function _updateShippingMethods($update_array) { global $application; $tables = $this->getTables(); $methods_table = $tables['sm_dsr_methods']['columns']; $query = new DB_Update('sm_dsr_methods'); $query->addUpdateValue($methods_table['available'], "N"); $application->db->getDB_Result($query); if (count($update_array) == 0 or !is_array($update_array)) { return; } $query = new DB_Update('sm_dsr_methods'); $query->addUpdateValue($methods_table['available'], "Y"); $query->Where($methods_table['id'], DB_IN, "('" . implode("','", array_keys($update_array)) . "')"); $application->db->getDB_Result($query); return; }
function __setStatusForAllHotlinksOfOrder($order_id, $status) { global $application; $tables = $this->getTables(); $hl_table = $tables['pf_hotlinks']['columns']; $opids = modApiFunc('Checkout', 'getOrderProductsIDs', $order_id); if (!empty($opids)) { $query = new DB_Update('pf_hotlinks'); $query->addUpdateValue($hl_table['status'], $status); $query->Where($hl_table['order_product_id'], DB_IN, "('" . implode("','", $opids) . "')"); $application->db->PrepareSQL($query); $application->db->DB_Exec(); } }