function add_cart_item_data($cart_item_meta, $product_id)
 {
     if (isset($cart_item_meta['wbm_product_cart'])) {
         return $cart_item_meta;
     }
     if (WBM_Frontend_Product::wbm_enabled($product_id) && isset($_POST["wbm_product_cart"]) && $_POST["wbm_product_cart"] == 1 && check_admin_referer('wbm_product_cart_' . $product_id)) {
         $cart_item_meta['wbm_product_cart'] = $_POST["wbm_product_cart"];
         $cart_item_meta['wbm_product_price'] = $_POST["wbm_product_price"];
         $cart_item_meta['wbm_product_attributes'] = $_POST["wbm_attributes"];
     }
     return $cart_item_meta;
 }
        public function wbm_footer()
        {
            global $post;
            if (WBM_Frontend_Product::wbm_enabled($post->ID)) {
                $productId = $post->ID;
                $secondary_attr_id = get_post_meta($productId, '_wbm_sub_attribute', true);
                $secondary_variations = get_terms($secondary_attr_id);
                ?>
                <div id="wbm_hidden_container" class="wbm_hidden">
                <div id="wbm_main_attr">
                    <input type="hidden" value="" class="wbm_title">
                    <input type="hidden" value="" class="wbm_term">
                </div>
                <?php 
                if (isset($secondary_variations) && !empty($secondary_variations)) {
                    foreach ($secondary_variations as $variation) {
                        if (has_term(absint($variation->term_id), $secondary_attr_id, $productId)) {
                            ?>
                        <div id="wbm_attr_<?php 
                            echo $variation->taxonomy;
                            ?>
_<?php 
                            echo $variation->term_id;
                            ?>
" class="wbm_attr_container">
                            <div class="wbm_secondary_container">
                                <input type="hidden" value="" class="wbm_title">
                                <input type="hidden" value="" class="wbm_term">
                                <input type="hidden" value="no" class="wbm_check">
                                <input type="hidden" value="" class="wbm_price">
                            </div>
                            <div class="wbm_selectbox_container">

                            </div>
                            <div class="wbm_date_container">

                            </div>
                        </div>
                <?php 
                        }
                    }
                }
                ?>
                </div>
            <?php 
            }
        }