<?php 
    echo wkp_check_and_show_alert_for_dependent_plugin('woocommerce', 'woocommerce.php', 'free');

    if(wkp_check_dependent_plugin('woocommerce', 'woocommerce.php')):
        /**
         * check if single product page 
         * and single page
         */
        if( is_product() ):
            ?>
                <?php
                    $product = wc_get_product( get_the_ID() );
                    $type = $product->get_type();
                    $price = $product->get_price_html();
                ?>
                <div class="related-product-wrapper">
                    <?php 
                    /**
                     * if you need to more details 
                     * go over that function
                     * this function received an array 
                     * and you can override default arguents
                     * below are the default values that you 
                     * can pass through while call the function
                     * $defaults = array(
                     *      'posts_per_page' => 2,
                     *      'columns'        => 2,
                     *      'orderby'        => 'rand',
                     *      'order'          => 'desc',
                     * );
                     */
                    woocommerce_related_products(['posts_per_page'=> $product_to_show , 'columns' => $product_column ]);
                    ?>
                </div>
            <?php   
        else:
            echo '<h2 style="border:solid 5px red; padding:30px;">This element only works for WooCommerce Single Product Page</h2>';
        endif;
    endif;
?>