Woocommerce Terms & Conditions showing code

Just built a new site all in Pro and the terms & Conditions page in Woocommerce would only show code. none of the other topics i found resolved my issues, the JS popup worked but on my site the div was still toggled and customers could see my ugly code instead of the page. installing Visual composer did absolutely nothing I still saw the code. I cant build just using Classic elements because I am using a new install and have all the new sections and rows not classic ones so i still see the code wrapped around my classic elements.

i did find this piece of code that disables the div toggle and opens the page on a new tab, it will work for now but I would like to see some sort of fix to this bug.

Here is the code, simply use Code Snippets plugin or add to your functions.php

function disable_wc_terms_toggle() {
	wp_enqueue_script( 'disable-terms-toggle', '/disable-terms-toggle.js', array( 'wc-checkout', 'jquery' ), null, true );
	wp_add_inline_script( 'disable-terms-toggle', "jQuery( document ).ready( function() { jQuery( document.body ).off( 'click', 'a.woocommerce-terms-and-conditions-link' ); } );" );
}

add_action( 'wp_enqueue_scripts', 'disable_wc_terms_toggle', 1000 ); 

Thanks!

Hello There,

Thanks for writing in! The classic elements and v2 elements will work simultaneously on new installs. You can even mixed it up on the page.

The code snippet that you are using is the best way. When you add it to a text element within the page, it will not work and will just display the plain code. This might be the case prior to adding your code snippet.

Could you please provide us the url of your Terms & Condition so that we can take a closer look?

Thank you in advance.

Thanks for the feedback, I will add the info to a secure note.

Hi there,

The only solution for that is using classic elements instead of v2 elements. I can confirm the issue, it’s similar to issues where shortcode are copied and used somewhere and it won’t work. That’s because the shortcode is bound the page where it’s created.

And since the term page is a simple content, you can just remove the v2 shortcodes (rows and columns) through TEXT editor, then just leave the classic shortcode in there. I could provide a sample if you can convert your page to classic elements :slight_smile:

Thanks!

I appreciate the help. I just created a simple page using the text editor instead of Pro to display on the checkout page. Is there any way this can be fixed in the future? Right now I have 2 pages, 1 simple one just for checkout and 1 Pro one that users can navigate to that looks better and utilizes Pro features.

Thanks again!

Hey There,

We’ve added this as a enhancement request so it can be taken into consideration and fixed this in the future releases.

Thank you for your understanding.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.