wcps_layout_element_thumbnail_url

add_filter('wcps_layout_element_thumbnail_url', 'wcps_layout_element_thumbnail_url_10102020', 10, 2);
function wcps_layout_element_thumbnail_url_10102020($permalink, $args){

    //echo '<pre>'.var_export($args, true).'</pre>';
    $product_id = isset($args['product_id']) ? $args['product_id'] : '';
    $elementData = isset($args['elementData']) ? $args['elementData'] : array();
    $link_to = isset($elementData['link_to']) ? $elementData['link_to'] : '';


    if($link_to == 'product_link'){
        $permalink = get_permalink($product_id);

    }elseif ($link_to == 'external_product_url'){
        $product = wc_get_product( $product_id );

        if($product->is_type('external')){
            $permalink = get_post_meta($product_id,'_product_url', true);
        }else{
            $permalink = get_permalink($product_id);
        }
    }

    return $permalink;

}