Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1092504

    I updated my theme and woocommerce and for whatever reason, the product purchase button element is putting the name of the product next to the quantity label.

    Can someone point me in the right direction to remove the product title from this label? Even if I have to edit the php… Thanks….

    Cheers,
    BC

    #1092558

    Hey smoke_house,
    I took a look at your page and see that the “screen-reader-text” label is what is printing next to your quantity button.
    This is for blind visitors to visit and use your site with the help of special browsers. You can read more about this here This css is recommend to hide the text from most visitors but allow the screen readers to still work.
    Please try this code in the General Styling > Quick CSS field or in the WordPress > Customize > Additional CSS field:

    #top #main .screen-reader-text { 
       border:0;   
       clip: rect(1px, 1px, 1px, 1px); 
       clip-path: inset(50%);
       height: 1px; 
       margin: -1px;
       width: 1px; 
       overflow: hidden; 
       position: absolute !important;
       word-wrap:normal !important;
    }

    Best regards,
    Mike

    #1104976

    Hello,

    I inserted that code however it removed the word “quantity” as well, which I need to keep.

    Help. :-)

    #1105157

    Hi,
    Thank you, Please try this code in the General Styling > Quick CSS field or in the WordPress > Customize > Additional CSS field:

    #top.postid-4574 .av-woo-purchase-button .quantity label.screen-reader-text {
        margin-left: 30% !important; 
        margin-right: 5% !important; 
    }

    and add this code to the end of your functions.php file in Appearance > Editor:

    function custom_script(){
      ?>
      <script>
    (function($){
      $(document).ready(function(){
      $('#top.postid-4574 .av-woo-purchase-button .quantity label.screen-reader-text').each(function() {
        var text = $(this).text();
        $(this).text(text.replace('Candy Box subscription ', ' ')); 
    });
    });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'custom_script');

    Best regards,
    Mike

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