Exemplo n.º 1
0
/**
 * Returns wizard advanced mode settings
 * @return array
 */
function get_integration_settings()
{
    $archive_multiple_settings = get_multiple_settings();
    $settings['container_width'] = isset($archive_multiple_settings['container_width']) ? $archive_multiple_settings['container_width'] : 100;
    $settings['container_bg'] = isset($archive_multiple_settings['container_bg']) ? $archive_multiple_settings['container_bg'] : '';
    $settings['container_padding'] = isset($archive_multiple_settings['container_padding']) ? $archive_multiple_settings['container_padding'] : 0;
    $settings['disable_breadcrumbs'] = isset($archive_multiple_settings['enable_product_breadcrumbs']) && $archive_multiple_settings['enable_product_breadcrumbs'] == 1 ? 0 : 1;
    $settings['disable_name'] = isset($archive_multiple_settings['disable_name']) ? $archive_multiple_settings['disable_name'] : 0;
    $settings['disable_image'] = is_ic_product_gallery_enabled() ? 0 : 1;
    $settings['disable_price'] = is_ic_price_enabled() ? 0 : 1;
    $settings['disable_shipping'] = is_ic_shipping_enabled() ? 0 : 1;
    $settings['disable_attributes'] = is_ic_attributes_enabled() ? 0 : 1;
    $settings['default_sidebar'] = isset($archive_multiple_settings['default_sidebar']) ? $archive_multiple_settings['default_sidebar'] : 'none';
    return $settings;
}
Exemplo n.º 2
0
function register_filter_widgets()
{
    register_widget('product_category_filter');
    register_widget('product_sort_filter');
    if (is_ic_price_enabled()) {
        register_widget('product_price_filter');
    }
}
Exemplo n.º 3
0
function al_product_price()
{
    global $post;
    echo '<input type="hidden" name="pricemeta_noncename" id="pricemeta_noncename" value="' . wp_create_nonce(plugin_basename(__FILE__)) . '" />';
    $price_table = '';
    if (is_ic_price_enabled()) {
        $set = get_currency_settings();
        $price = get_post_meta($post->ID, '_price', true);
        $price_table = apply_filters('admin_price_table', '<table><tr><td class="label-column">' . __('Price', 'al-ecommerce-product-catalog') . ':</td><td class="price-column"><input type="text" title="' . sprintf(__('Example price format: %s or %s', 'al-ecommerce-product-catalog'), price_format('1587.89', 1, 0), '1587' . $set['dec_sep'] . '89') . '" pattern="^(([1-9](\\d*|\\d{0,2}(' . $set['th_sep'] . '\\d{3})*))|0)(\\' . $set['dec_sep'] . '\\d{1,2})?$" name="_price" value="' . $price . '" class="widefat" /></td><td>' . product_currency() . '</td></tr></table>', $post);
        $price_table .= '<div id="invalid-_price" class="ui-state-error ui-corner-all message" style="padding: 0 .7em; display: none;"><p>' . sprintf(__('Please provide a correct price format according to your currency settings. Example price format: %s or %s', 'al-ecommerce-product-catalog'), price_format('1587.89', 1, 0), '1587' . $set['dec_sep'] . '89') . '</p></div>';
    }
    if (is_ic_sku_enabled()) {
        $sku = get_post_meta($post->ID, '_sku', true);
        $sku_table = apply_filters('admin_sku_table', '<table><tr><td class="label-column">' . __('SKU', 'al-ecommerce-product-catalog') . ':</td><td class="sku-column"><input type="text" name="_sku" value="' . $sku . '" class="widefat" /></td></tr></table>', $post);
        $price_table .= $sku_table;
    }
    echo $price_table;
}
Exemplo n.º 4
0
/**
 * Returns product price
 *
 * @param int $product_id
 * @param string $unfiltered Assign any value to return the original price (without any modifications)
 * @return string
 */
function product_price($product_id, $unfiltered = null)
{
    if (empty($unfiltered)) {
        $price_value = apply_filters('product_price', get_post_meta($product_id, "_price", true), $product_id);
    } else {
        $price_value = apply_filters('unfiltered_product_price', get_post_meta($product_id, "_price", true), $product_id);
    }
    $price_value = is_ic_price_enabled() ? $price_value : '';
    return $price_value;
}
Exemplo n.º 5
0
function al_product_price()
{
    global $post;
    echo '<input type="hidden" name="pricemeta_noncename" id="pricemeta_noncename" value="' . wp_create_nonce(plugin_basename(__FILE__)) . '" />';
    $price_table = '';
    if (is_ic_price_enabled()) {
        $price = get_post_meta($post->ID, '_price', true);
        $price_table = apply_filters('admin_price_table', '<table><tr><td class="label-column">' . __('Price', 'al-ecommerce-product-catalog') . ':</td><td class="price-column"><input type="number" min="0" step="0.01" name="_price" value="' . $price . '" class="widefat" /></td><td>' . product_currency() . '</td></tr></table>', $post);
    }
    if (is_ic_sku_enabled()) {
        $sku = get_post_meta($post->ID, '_sku', true);
        $sku_table = apply_filters('admin_sku_table', '<table><tr><td class="label-column">' . __('SKU', 'al-ecommerce-product-catalog') . ':</td><td class="sku-column"><input type="text" name="_sku" value="' . $sku . '" class="widefat" /></td></tr></table>', $post);
        $price_table .= $sku_table;
    }
    echo $price_table;
}