Ecommerce Shopify WordPress Discussion

Shortcode with woocommerce_before_customer_login_form won't reference overridden template file

I am currently using wordpress and am creating a customized theme, i succesfully over-ridden the old myaccount form-login.php file as it works perfectly for the my-account page, but I used a shortcode from here and used it on my theme add_shortcode( 'wc_reg_form_bbloomer', 'bbloomer_separate_registration_form' ); function bbloomer_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->saveXML( $form ); return ob_get_clean(); } add_shortcode( 'wc_login_form_bbloomer', 'bbloomer_separate_login_form' ); function bbloomer_separate_login_form() { if ( is_user_logged_in() ) return '<p>You are already logged in</p>'; ob_start(); do_action( 'woocommerce_before_customer_login_form' ); woocommerce_login_form( array( 'redirect' => wc_get_page_permalink( 'myaccount' ) ) ); return ob_get_clean(); } So after putting calling the shortcode in 2 separate pages, it still references the original template file for some reason, I put the above code in the functions.php file at the end after confirming compatibility with woocommerce. I am also pretty sure that the template override of the form-login.php works fine since I tried making some changes in the my-account page and it worked just fine. Hopefully I could get some help, thanks !
fixed this by redoing the woocommerce_before_customer_login_form function then writing down the code from scrath, then running it again. Hope this helps others !

December 29, 2023

TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.