Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #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 pages

    is there a solution?

    #838241

    update:
    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?

    #838271

    Hi,
    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.

    Create a Store for Customers Only with WooCommerce

    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

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.