radykal | Support Center Chooser

For which product do you need support?

Fancy Product Designer Multistep Product Configurator Another

Start a new topic

Ability to remove filter "woocommerce_cart_item_name"

Hello.
I am can not remove filter "woocommerce_cart_item_name" in my code.
Add please method getInstance to class FPD_WC_Cart:
<?php

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

if(!class_exists('FPD_WC_Cart')) {

   class FPD_WC_Cart {

      public static $instance;

      public static function getInstance() {
         if (self::$instance === null) {
            self::$instance = new self();
         }
         return self::$instance;
      }

      public function __construct() {
         self::$instance = $this;

Then I can do like this:
remove_filter( 'woocommerce_cart_item_name', [ FPD_WC_Cart::getInstance(), 'reset_cart_item_link' ], 100);


Sorry this will not be implemented. If you want to remove the filter, just comment the line.

If you can, please explain why not?

Login or Signup to post a comment