post_content); $video_content = $video_content_id->guid; $meta = get_post_meta($video->ID, 'hot_spots'); $controls = get_post_meta($video->ID, 'controls'); $tooltips_closed = get_post_meta($video->ID, 'tooltips_closed'); $font = get_post_meta($video->ID, 'font'); $weight = get_post_meta($video->ID, 'weight'); $showcontrols = ''; $tooltips_closed_classes = ['', '', '', '', '', '']; $hotspots = json_decode($meta[0], true); if($controls[0] == 'true') { $showcontrols = 'controls'; } if($tooltips_closed[0] == 'true'){ $tooltips_closed_classes[0] = 'product__popup--minimized'; $tooltips_closed_classes[1] = 'product__info-container--minimized'; $tooltips_closed_classes[2] = 'product-data__container--minimized'; $tooltips_closed_classes[3] = 'product__thumbnail--minimized'; $tooltips_closed_classes[4] = 'minimize__popup-arrow-left--minimized'; $tooltips_closed_classes[5] = 'minimize__popup-arrow-right--minimized'; } $hotspot_image_1 = plugin_dir_url( __FILE__ ) . '../assets/img/hotspot-white-new.png'; $hotspot_image_2 = plugin_dir_url( __FILE__ ) . '../assets/img/transparent-hotspot.png'; $hotspot_image_3 = plugin_dir_url( __FILE__ ) . '../assets/img/hotspot-white.png'; $popup_arrow_left = plugin_dir_url( __FILE__ ) . '../assets/img/popup-arrow-left.png'; $popup_arrow_right = plugin_dir_url( __FILE__ ) . '../assets/img/popup-arrow-right.png'; $content .= "
"; foreach($hotspots as $hotspot) { if ( class_exists( 'WooCommerce' ) ) { $product = wc_get_product( $hotspot['product_id'] ); $content .= "
button image
"; if(is_a($product, 'WC_Product') && $hotspot['option'] == 'product') { $content .="
". $product->get_name() ." ".get_woocommerce_currency_symbol() . ' ' . $product->get_price() ." SHOP NOW
"; } } if($hotspot['option'] == 'custom-product') { $content .="
"; } } $content .= "
"; return $content; } }