This code snippet is useful for situations like creating separate Login and Registration pages.
<?php
add_shortcode("wc_reg_form_wptu", "wptu_separate_registration_form");
function wptu_separate_registration_form()
{
if (is_user_logged_in()) {
return "<p>You are already registered</p>";
}
ob_start();
do_action("woocommerce_before_customer_login_form");
$html = wc_get_template_html("myaccount/form-login.php");
$dom = new DOMDocument();
$dom->encoding = "utf-8";
$dom->loadHTML(utf8_decode($html));
$xpath = new DOMXPath($dom);
$form = $xpath->query('//form[contains(@class,"register")]');
$form = $form->item(0);
echo $dom->saveHTML($form);
return ob_get_clean();
}