<?php /** * Plugin Name: BME Wow * Description: Styles premium BME Shop (Blocksy + WooCommerce). * Version: 1.0.11 */ if ( ! defined( 'ABSPATH' ) ) { exit; } add_action( 'wp_enqueue_scripts', static function () { if ( is_admin() ) { return; } wp_enqueue_style( 'bme-wow', WPMU_PLUGIN_URL . '/bme-wow.css', array(), '1.0.11' ); }, 999 ); $bme_wide_search_cb = static function () { static $printed = false; if ( $printed ) { return; } if ( is_admin() ) { return; } if ( function_exists( 'is_customize_preview' ) && is_customize_preview() ) { return; } if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) { return; } if ( defined( 'IFRAME_REQUEST' ) && IFRAME_REQUEST ) { return; } $printed = true; $action = esc_url( home_url( '/' ) ); $query = get_search_query(); $account_url = function_exists( 'wc_get_page_permalink' ) ? wc_get_page_permalink( 'myaccount' ) : wp_login_url(); $cart_url = function_exists( 'wc_get_cart_url' ) ? wc_get_cart_url() : home_url( '/cart/' ); $cart_count = 0; if ( function_exists( 'WC' ) && WC()->cart ) { $cart_count = (int) WC()->cart->get_cart_contents_count(); } $svg_user = '<svg class="bme-ico" width="22" height="22" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path d="M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><circle cx="12" cy="7" r="4" stroke="currentColor" stroke-width="2"/></svg>'; $svg_cart = '<svg class="bme-ico" width="22" height="22" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path d="M6 6h15l-1.5 9H7.5L6 6z" stroke="currentColor" stroke-width="2" stroke-linejoin="round"/><circle cx="9" cy="20" r="1" fill="currentColor"/><circle cx="17" cy="20" r="1" fill="currentColor"/></svg>'; $brand_text = 'BME Shop'; echo '<div class="bme-wide-search" role="search" aria-label="' . esc_attr__( 'Recherche produits', 'bme-wow' ) . '">'; echo '<div class="bme-wide-search__inner">'; echo '<div class="bme-wide-search__logoWrap">'; echo '<a class="bme-wide-search__textLogo" href="' . esc_url( home_url( '/' ) ) . '">' . esc_html( $brand_text ) . '</a>'; echo '</div>'; echo '<form class="woocommerce-product-search bme-wide-search__form" method="get" action="' . $action . '">'; echo '<label class="screen-reader-text" for="bme-wide-search-field">' . esc_html__( 'Search', 'woocommerce' ) . '</label>'; echo '<input type="search" id="bme-wide-search-field" class="search-field" name="s" value="' . esc_attr( $query ) . '" placeholder="' . esc_attr__( 'Search products&hellip;', 'woocommerce' ) . '" autocomplete="off" />'; echo '<input type="hidden" name="post_type" value="product" />'; echo '</form>'; echo '<div class="bme-wide-search__actions">'; echo '<a class="bme-wide-search__action" href="' . esc_url( $account_url ) . '" title="' . esc_attr__( 'My account', 'woocommerce' ) . '">' . $svg_user . '</a>'; echo '<a class="bme-wide-search__action bme-wide-search__cartLink" href="' . esc_url( $cart_url ) . '" title="' . esc_attr__( 'Cart', 'woocommerce' ) . '">'; echo $svg_cart; if ( $cart_count > 0 ) { echo '<span class="bme-wide-search__cartBadge">' . esc_html( (string) $cart_count ) . '</span>'; } echo '</a>'; echo '</div>'; echo '</div></div>'; }; add_action( 'wp_body_open', $bme_wide_search_cb, 20 ); add_action( 'elementor/page_templates/canvas/before_content', $bme_wide_search_cb, 1 ); add_action( 'wp_footer', static function () { if ( is_admin() ) { return; } if ( function_exists( 'is_customize_preview' ) && is_customize_preview() ) { return; } ?> <script> (function () { var bar = document.querySelector('.bme-wide-search'); if (!bar) { return; } var onScroll = function () { var y = window.scrollY || document.documentElement.scrollTop; bar.classList.toggle('bme-wide-search--scrolled', y > 12); }; window.addEventListener('scroll', onScroll, { passive: true }); window.addEventListener('resize', onScroll); onScroll(); })(); </script> <?php }, 99 ); https://test.domirix.com/wp-sitemap-posts-post-1.xmlhttps://test.domirix.com/wp-sitemap-posts-page-1.xmlhttps://test.domirix.com/wp-sitemap-posts-product-1.xmlhttps://test.domirix.com/wp-sitemap-taxonomies-category-1.xmlhttps://test.domirix.com/wp-sitemap-taxonomies-product_cat-1.xmlhttps://test.domirix.com/wp-sitemap-users-1.xml