Example #1
0
/**
 * Returns current product ID
 *
 * @global type $implecode
 * @return type
 */
function ic_get_product_id()
{
    $product_id = ic_get_global('product_id');
    if (!$product_id) {
        $product_id = get_the_ID();
        ic_save_global('product_id', $product_id);
    }
    return $product_id;
}
Example #2
0
/**
 * Returns single names settings
 *
 * @return type
 */
function get_single_names()
{
    $single_names = ic_get_global('single_names');
    if (!$single_names) {
        $default_single_names = default_single_names();
        $single_names = get_option('single_names', $default_single_names);
        foreach ($default_single_names as $key => $value) {
            $single_names[$key] = isset($single_names[$key]) ? $single_names[$key] : $value;
        }
        ic_save_global('single_names', $single_names);
    }
    return $single_names;
}
Example #3
0
/**
 * Returns the number of defined product attributes
 *
 * @return int
 */
function product_attributes_number()
{
    $number = ic_get_global('product_attributes_number');
    if (!$number) {
        $number = get_option('product_attributes_number', 3);
        ic_save_global('product_attributes_number', $number);
    }
    return $number;
}