Tweak terms template to check the woocommerce_shortcode is not present in the content.
This commit is contained in:
parent
02ffdaf8f5
commit
671f052641
|
@ -616,8 +616,10 @@ jQuery( function( $ ) {
|
|||
},
|
||||
|
||||
toggle_terms: function() {
|
||||
$( '.woocommerce-terms-and-conditions' ).slideToggle();
|
||||
return false;
|
||||
if ( $( '.woocommerce-terms-and-conditions' ).length ) {
|
||||
$( '.woocommerce-terms-and-conditions' ).slideToggle();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @author WooThemes
|
||||
* @package WooCommerce/Templates
|
||||
* @version 3.1.0
|
||||
* @version 3.1.1
|
||||
*/
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
|
@ -14,11 +14,12 @@ $terms_page_id = wc_get_page_id( 'terms' );
|
|||
|
||||
if ( $terms_page_id > 0 && apply_filters( 'woocommerce_checkout_show_terms', true ) ) :
|
||||
$terms = get_post( $terms_page_id );
|
||||
$terms_content = wc_format_content( $terms->post_content );
|
||||
?>
|
||||
<?php
|
||||
$terms_content = has_shortcode( $terms->post_content, 'woocommerce_checkout' ) ? '' : wc_format_content( $terms->post_content );
|
||||
|
||||
if ( $terms_content ) {
|
||||
do_action( 'woocommerce_checkout_before_terms_and_conditions' );
|
||||
echo '<div class="woocommerce-terms-and-conditions" style="display: none; max-height: 200px; overflow: auto;">' . $terms_content . '</div>';
|
||||
}
|
||||
?>
|
||||
<p class="form-row terms wc-terms-and-conditions">
|
||||
<label class="woocommerce-form__label woocommerce-form__label-for-checkbox checkbox">
|
||||
|
|
Loading…
Reference in New Issue