コード例 #1
0
/**
 * Import product company
 *
 * @param integer $product_id Product ID
 * @param string $company_name Company name
 * @return boolean
 */
function fn_exim_set_product_company($product_id, $company_name)
{
    $company_id = fn_exim_set_company('products', 'product_id', $product_id, $company_name);
    if ($company_id) {
        // Assign company_id to all product options
        $options_ids = db_get_fields('SELECT option_id FROM ?:product_options WHERE product_id = ?i', $product_id);
        if ($options_ids) {
            db_query("UPDATE ?:product_options SET company_id = ?s WHERE option_id IN (?a)", $company_id, $options_ids);
        }
    }
    return $company_id;
}
コード例 #2
0
function fn_exim_set_em_subscriber_company($subscriber_id, $company_name)
{
    $company_id = fn_exim_set_company('em_subscribers', 'subscriber_id', $subscriber_id, $company_name);
}