I've used this check meta box in my functions.php but I don't understand how I can get the meta data. I'm trying to output if a product is still available or not.
Metabox setup:
/* Array of the meta box options. */
$meta_boxes = array(
'affiliate-url' => array( 'name' => 'Affiliate_url', 'title' => __('Affiliate URL (generated)', 'hybrid'), 'type' => 'text' ),
'original-url' => array( 'name' => 'Original_url', 'title' => __('Original URL', 'hybrid'), 'type' => 'text' ),
'product-id' => array( 'name' => 'Product_ID', 'title' => __('Product ID', 'hybrid'), 'type' => 'text' ),
'normal-price' => array( 'name' => 'Normal_price', 'title' => __('Normal Price', 'hybrid'), 'type' => 'text' ),
'discount-price' => array( 'name' => 'Discount_price', 'title' => __('Discount Price', 'hybrid'), 'type' => 'text' ),
'sizes-available' => array(
'name' => 'Sizes_available',
'title' => __('Currently available:', 'hybrid'),
'type' => 'check',
'options' => array(
'XS' => 'Extra Small',
'S' => 'Small',
'M' => 'Medium',
'L' => 'Large',
'XL' => 'Extra Large',
'XXL' => 'Extra Extra Large',
),
Template setup:
<div class="col-md-6 col-xs-6 product-info">
<h5>AVAILABLE IN</h5>
<ul>
<li>Small</li>
<li><strike>Medium</strike> <small>(sold out)</small></li>
<li>Large</li>
<li>Xtra Large</li>
<li>Xtra Xtra large</li>
</ul>
</div>
I need to output the list and place <strike>$size</strike> <small> (sold out)</small>
.
Normaly I use <?php if ( get_post_meta($post->ID, 'Sizes_available', true) ) : ?>
to check if something is filled in the meta box but this doesn't apply for a 'checked' output.
Can anybody help?