/**
 * Returns sku table for product page
 *
 * @param int $product_id
 * @param array $single_names
 * @return string
 */
function get_product_sku_table($product_id, $single_names)
{
    $sku_value = get_product_sku($product_id);
    $table = '';
    if (is_ic_sku_enabled() && !empty($sku_value)) {
        $table .= '<table class="sku-table">';
        $table .= '<tr>';
        $table .= '<td>' . $single_names['product_sku'] . '</td>';
        $table .= '<td class="sku-value">' . $sku_value . '</td>';
        $table .= '</tr>';
        $table .= '</table>';
    }
    return $table;
}
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;
}
Esempio 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()) {
        $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;
}
Esempio n. 4
0
function show_sku($post, $single_names)
{
    $sku_value = get_post_meta($post->ID, '_sku', true);
    if (is_ic_sku_enabled() && !empty($sku_value)) {
        ?>
        <table class="sku-table">
            <tr>
                <td><?php 
        echo $single_names['product_sku'];
        ?>
</td>
                <td class="sku-value"><?php 
        echo $sku_value;
        ?>
</td>
            </tr>
        </table>
    <?php 
    }
}
Esempio n. 5
0
    exit;
    // Exit if accessed directly
}
/**
 * The template to display product SKU on product page or with a shortcode
 *
 * Copy it to your theme implecode folder to edit the output: your-theme-folder-name/implecode/product-sku.php
 *
 * @version		1.1.2
 * @package		ecommerce-product-catalog/templates/template-parts/product-page
 * @author 		Norbert Dreszer
 */
$product_id = ic_get_product_id();
$single_names = get_single_names();
$sku_value = get_product_sku($product_id);
if (is_ic_sku_enabled() && !empty($sku_value)) {
    ?>

	<table class="sku-table">
		<tr>
			<td><?php 
    echo $single_names['product_sku'];
    ?>
</td>
			<td class="sku-value"><?php 
    echo $sku_value;
    ?>
</td>
		</tr>
	</table>