Support » Plugin: YITH WooCommerce Compare » Counter

  • manaraga

    (@manaraga)



    Good day. I need a counter of products in compare near “go to compare result” button.
    I think its a baseic functionality, “Must have” for pcompare plugins!!!

Viewing 1 replies (of 1 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Good day,
    at this moment is not possible to do that, if you want to do this on your own you need to customize the method add_compare_link() of class YITH_Woocompare_Frontend and add the counter.
    You can get the number of product on compare by using this code snippet

    $products_list = isset( $_COOKIE[ $this->cookie_name ] ) ? json_decode( $_COOKIE[ $this->cookie_name ] ) : array();
    $count_products = count( $products_list );

    so, $count_products is the number of products currently on compare table.
    We’ll consider add this on next plugin update.

    Regards 🙂

Viewing 1 replies (of 1 total)
  • The topic ‘Counter’ is closed to new replies.