• Resolved Pom

    (@pomonthebeach)


    How can hidden Sticky Add To Cart tab when added product to cart already?

    • This topic was modified 4 years, 3 months ago by Pom.
    • This topic was modified 4 years, 3 months ago by Pom.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Sharaz Shahid

    (@sharaz)

    Hi @pomonthebeach ,

    Please add the following snippet in your theme funcations.php. It will hide sticky add to cart. If the product already added to the cart.

    add_filter( 'wsatc_product_hide', 'wsatc_hide_sticky_bar', 10, 2 );
    
    function wsatc_hide_sticky_bar( $is_hide, $product_id ) {
    	global $woocommerce;
    	foreach($woocommerce->cart->get_cart() as $key => $val ) {
    			$_product = $val['data'];
    			if($product_id == $_product->id ) {
    					return true;
    			}
    	} 
    		return $is_hide;
    }
    • This reply was modified 4 years, 3 months ago by Sharaz Shahid.
    Thread Starter Pom

    (@pomonthebeach)

    Thank you Sharaz Shahid

    What wrong for me because I add your hook code to theme’s function.php but when I try to added product to cart Simple Sticky Add To Cart tab still show on the bottom product page ?

    Plugin Author Sharaz Shahid

    (@sharaz)

    Hi @pomonthebeach,

    We need some more detail can your submit your issue there https://solbox.dev/support/ .

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How can hidden tab when added product to cart already?’ is closed to new replies.