/**
 * 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;
}
Example #2
0
/**
 * Shows product SKU value
 *
 * @param type $atts
 * @return string
 */
function ic_product_sku($atts)
{
    $args = shortcode_atts(array('product' => get_the_ID()), $atts);
    return get_product_sku($args['product']);
}
Example #3
0
if (!defined('ABSPATH')) {
    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>