Tagged: shopping cart icon, woocommerce
-
AuthorPosts
-
August 13, 2017 at 2:49 pm #838231
my client doesn’t want anybody surfing his website to know he got a shop
(of course Except the one’s getting a link to the shop page via email etc)
long story short: is there a way to hide the cart icon from all pages beside the shop pages?I tried using the enfold ‘display floating on the side, but only once product is added’ setting for the cart icon
but the client wants it to be always present in the shop pagesis there a solution?
August 13, 2017 at 3:58 pm #838241update:
I think i can achieve it by using page id code ..something like:.page-id-1760 .cart_dropdown { display: none; }
but it’s very manual (because i have to list all ‘not shop pages’ one by one)
any chance there’ a better solution?August 13, 2017 at 5:51 pm #838271Hi,
I think you would do better to use a plugin for this, I found this article about how to do so, but you could also try a little plugin searching.I also found this function for functions.php, but I didn’t test, so use at your own risk:
add_action( 'wp_enqueue_scripts', 'dequeue_woocommerce_styles_scripts', 99 ); function dequeue_woocommerce_styles_scripts() { if ( function_exists( 'is_woocommerce' ) ) { if ( ! is_woocommerce() && ! is_cart() && ! is_checkout() ) { # Styles wp_dequeue_style( 'woocommerce-general' ); wp_dequeue_style( 'woocommerce-layout' ); wp_dequeue_style( 'woocommerce-smallscreen' ); wp_dequeue_style( 'woocommerce_frontend_styles' ); wp_dequeue_style( 'woocommerce_fancybox_styles' ); wp_dequeue_style( 'woocommerce_chosen_styles' ); wp_dequeue_style( 'woocommerce_prettyPhoto_css' ); # Scripts wp_dequeue_script( 'wc_price_slider' ); wp_dequeue_script( 'wc-single-product' ); wp_dequeue_script( 'wc-add-to-cart' ); wp_dequeue_script( 'wc-cart-fragments' ); wp_dequeue_script( 'wc-checkout' ); wp_dequeue_script( 'wc-add-to-cart-variation' ); wp_dequeue_script( 'wc-single-product' ); wp_dequeue_script( 'wc-cart' ); wp_dequeue_script( 'wc-chosen' ); wp_dequeue_script( 'woocommerce' ); wp_dequeue_script( 'prettyPhoto' ); wp_dequeue_script( 'prettyPhoto-init' ); wp_dequeue_script( 'jquery-blockui' ); wp_dequeue_script( 'jquery-placeholder' ); wp_dequeue_script( 'fancybox' ); wp_dequeue_script( 'jqueryui' ); } } }
Best regards,
Mike -
AuthorPosts
- You must be logged in to reply to this topic.