From 296f11daf27eb10d6d12419f974a02f9c014c7b8 Mon Sep 17 00:00:00 2001 From: Stephen Cameron Date: Tue, 23 Aug 2022 13:35:43 +0200 Subject: [PATCH] Remove redundant WooCommerce references. Wait #5342 @0.25 --- .../mu-plugins/physioassist/src/Init.php | 1 - .../physioassist/src/WooCommerce/Setup.php | 140 ------------------ 2 files changed, 141 deletions(-) delete mode 100644 wp-content/mu-plugins/physioassist/src/WooCommerce/Setup.php diff --git a/wp-content/mu-plugins/physioassist/src/Init.php b/wp-content/mu-plugins/physioassist/src/Init.php index 7eec85b..37fadc1 100644 --- a/wp-content/mu-plugins/physioassist/src/Init.php +++ b/wp-content/mu-plugins/physioassist/src/Init.php @@ -15,7 +15,6 @@ final class Init { // Marked as final because this class should never be extende return [ Common\Setup::class, Elementor\Setup::class, - WooCommerce\Setup::class, CookieNotice\Setup::class, ]; } diff --git a/wp-content/mu-plugins/physioassist/src/WooCommerce/Setup.php b/wp-content/mu-plugins/physioassist/src/WooCommerce/Setup.php deleted file mode 100644 index 4f9715b..0000000 --- a/wp-content/mu-plugins/physioassist/src/WooCommerce/Setup.php +++ /dev/null @@ -1,140 +0,0 @@ -cart->cart_contents_count < 1 - || !$isFrench - || $args->theme_location !== 'primary_navigation') { - return $menu; - } - - $menu .= template('woocommerce/mini-cart'); - - return $menu; - } - - public function woocommerce_add_to_cart_fragment($fragments) { - // Re-run and populate updated cart link template - $fragments['a.menu-cart-link'] = template('woocommerce/mini-cart-link'); - - return $fragments; - } - - public function add_to_cart_button($html, $product, $args) { - if ($product->is_purchasable() && !$product->is_sold_individually() && $product->is_in_stock() && 'variable' != $product->get_type() && 'bundle' != $product->get_type()) { - - return sprintf( - '%s', - esc_url( $product->add_to_cart_url() ), - esc_attr( isset( $args['quantity'] ) ? $args['quantity'] : 1 ), - //esc_attr( isset( $args['class'] ) ? $args['class'] : 'button' ), - 'add_to_cart_button ajax_add_to_cart', // WooCommerce CSS is a mess so just add these for the JS to hook - isset( $args['attributes'] ) ? wc_implode_html_attributes( $args['attributes'] ) : '', - \BladeSvgSage\svg_image('icons/cart-add')->toHtml() - ); - - //return '
'. print_r($args, true) .'
'; - } - - return $html; - } - - - public function cart_remove_link($html, $cart_item_key) { - - // Instead of trying to recreate the full HTML link with all the attributes, it's easier - // to replace the part we don't want: the × with the SVG icon - $icon = \BladeSvgSage\svg_image('icons/poubelle')->toHtml(); - - return str_replace('×', $icon, $html); - - } - - public function newsletter_checkbox() { - woocommerce_form_field('newsletter_subscribe', array( - 'type' => 'checkbox', - 'class' => [], - 'label' => __('Je souhaite recevoir la newsletter et les offres de PhysioAssist'), - 'required' => false, - 'default' => 1, // Pre-check the checkbox - ), WC()->checkout->get_value('newsletter_subscribe')); - } - - public function newsletter_checkbox_process($order_ID) { - - $newsletter = (isset($_POST['newsletter_subscribe']) && $_POST['newsletter_subscribe'] == 1) ? __('Oui') : __('Non'); - - update_post_meta($order_ID, 'Newsletter', $newsletter); - - // ToDo: send an e-mail notifying when there is a new subscriber - if ($newsletter === __('Oui')) { - // ADDRESS: $_POST['billing_email'] - } - - } - -} -- 2.39.5