Please submit a private ticket if you need to share sensitive information, such as license details and admin credentials.

Okay
  Public Ticket #3085093
Hidden Product Page for Product Bundle is Searchable on Google
Closed

Comments

  •  1
    John Kim started the conversation

    I have a Product Page for a single unit of my products, which are used to create multiple product bundles. I can only sell in bundles because of material and shipping costs, so these single unit pages need to be hidden. They are hidden from my website but are still searchable through Google, which is allowing consumers to buy quantities below the minimum I am supporting. Is there a way to hide these pages from Google as well?

    9953601782.png

    My list of available product bundles: https://cosmosfood.com/shop/

  •  767
    Janilyn replied

    Hi John,

    Thank you for contacting WPClever Support Forum. 

    We’ve received your ticket and assigned one of our developers to help you with that. 

    He’ll be looking into your question and responding with specific instructions as soon as possible. 

    Please stay patient as we're having very heavy workloads, it might take some time for our developers to reach back.

    Best regards.

    Janilyn T. - WPClever Support Agent

  •  153
    Henry replied

    Hi

    To solve your problem, we offer a solution to hide the Add to cart button on the product detail page of hidden products. So, the buyer can't buy these products even when accessing these pages.

    Please add the below custom code (How to add custom code?)

    // Hide the add to cart button
    add_action( 'woocommerce_before_single_product', function(){
        if( function_exists('is_product') && is_product() ) {
            global $product;
            if( $product->is_visible() == false ) {
                remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
                ?>    
                <script type="text/javascript"> 
                (function($) { 
                    $(document).ready(function() { 
                        $('button.button.alt').attr('disabled', 'true');
                        $('.quantity input.qty').attr('disabled', 'true');
                        $('a.button.alt').css('display', 'none');
                        $('button.button.alt').css('display', 'none');
                        $('.quantity input.qty').css('display', 'none');
                    }); 
                })(jQuery);    
                </script>    
                <?php
            }
        }    
    }, 99);

    Best regards,
    Henry N.