post_content); $video_content = $video_content_id->guid; $meta = get_post_meta($video->ID, 'hot_spots'); $hotspots = json_decode($meta[0], true); $hotspot_image_1 = plugin_dir_url( __FILE__ ) . '../assets/img/hotspot-yellow.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')) { $content .="
". $product->get_name() ." ".get_woocommerce_currency_symbol() . ' ' . $product->get_price() ." Shop now
"; } } } $content .= "
"; return $content; } }