0, ), $atts, 'studiou_free_photo_product'); $product_id = absint($atts['id']); if (!$product_id) { return '

' . esc_html__('Product ID is required.', 'studiou-wc-free-photo-product') . '

'; } $product = wc_get_product($product_id); if (!$product) { return '

' . esc_html__('Product not found.', 'studiou-wc-free-photo-product') . '

'; } if (!Studiou_WC_FPP_Product::is_fpp_product($product_id)) { return '

' . esc_html__('This product does not support photo upload.', 'studiou-wc-free-photo-product') . '

'; } if (!$product->is_type('variable')) { return '

' . esc_html__('This product must be a variable product.', 'studiou-wc-free-photo-product') . '

'; } // Enqueue assets wp_enqueue_style('studiou-wcfpp-frontend'); wp_enqueue_script('studiou-wcfpp-frontend'); // Get variations $variations = $product->get_available_variations(); $attributes = $product->get_variation_attributes(); $max_file_size = Studiou_WC_FPP_Product::get_product_max_file_size($product_id); ob_start(); include STUDIOU_WCFPP_PLUGIN_DIR . 'views/frontend-product.php'; return ob_get_clean(); } }