Uname: Linux premium294.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
Software: LiteSpeed
PHP version: 8.1.32 [ PHP INFO ] PHP os: Linux
Server Ip: 104.21.96.1
Your Ip: 216.73.216.223
User: mjbynoyq (1574) | Group: mjbynoyq (1570)
Safe Mode: OFF
Disable Function:
NONE

name : woocommerce.php
<?php

class Brizy_Compatibilities_Woocommerce
{

    static $noticesHtml;public function __construct() {
		add_action( 'woocommerce_checkout_terms_and_conditions',
			[ $this, 'woocommerce_checkout_terms_and_conditions' ],
			29 );
		add_action( 'wp_enqueue_scripts', [ $this, 'wp_enqueue_scripts' ], 11 );
		add_filter( 'brizy_template_content_compiled', [ $this, 'insertWooNotice' ] );
	}

    /*
     * Don't allow woo to render post_content of terms page if it is edited with brizy,
     * will lead to the display of the unformatted our html above the place order button on checkout page.
     */
    public function woocommerce_checkout_terms_and_conditions()
    {
        $terms_page_id = wc_terms_and_conditions_page_id();

        if (!$terms_page_id || !Brizy_Editor_Entity::isBrizyEnabled($terms_page_id)) {
            return;
        }

        remove_action('woocommerce_checkout_terms_and_conditions', 'wc_terms_and_conditions_page_content', 30);
    }

    public function wp_enqueue_scripts()
    {

        if (!Brizy_Public_Main::is_editing()) {
            return;
        }

        if ('geolocation_ajax' === get_option('woocommerce_default_customer_address')) {
            wp_dequeue_script('wc-geolocation');
        }
    }

    public function insertWooNotice($content)
    {
        $notices = wc_get_notices();

		if ( empty( $content ) || empty( $notices ) || ! strpos( $content, 'brz-section__header' ) || strpos( $content,
				'editor_woo_notice' ) ) {
			return $content;
		}

		$parser = new Brizy_Parser_Parser( $content );
		$parser = $parser->getParser();
		$cssClass = is_a( $parser,
			'Brizy_Parser_DomDocument' ) ? 'brz-section brz-section__header' : 'brz-section__header';

        if (!self::$noticesHtml) {
            self::$noticesHtml = wc_print_notices(true);
        }

        $parser->appendHtml('section', $cssClass, self::$noticesHtml);
        $html = $parser->getBody();

        return $html;
    }
}













© 2025 XylotrechusZ