The following worked for me setting the visibility on a divi section for a product page. My layout was overridden by the Divi Theme Builder. After some debugging it appears that the global $post object belongs to the Divi Theme builder not the rendered product page.
!empty(get_post_meta(get_queried_object_id(), 'your_field', true))