• Hi, I want to display this plugin’s Quantity button’s only on the Cart page and not other pages. How can I achieve this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • i had the same problem. try adding this to your functions.php or through code snippets plugin

    add_action( ‘wp_head’, function () {
    if ( is_product() ) {
    ?>
    <style>
    .qib-button:not(#qib_id):not(#qib_id) {
    display: none !important;
    }
    </style>
    <script>
    window.addEventListener(‘load’, function () {
    var qty_el = document.querySelector(‘div.qib-container’);
    qty_el.className = “quantity”;
    });
    </script>
    <?php
    }
    } );

    Thread Starter amolwp108

    (@amolwp108)

    @ivanpilien thank you for your reply.

    After this change, the quantity button gets messed up on the product page. Please see below images:

    Before your change:
    https://snipboard.io/2N1J6V.jpg

    After your change:
    https://snipboard.io/KgH6Gv.jpg

    ACtually the problem I’m facing is this – If I adjust the Height of the Quantity buttons then my “Add to Cart” box in the product page also becomes the same height as you can see from the first image. This is causing problem. If you can suggest a way that the height of Quantity button does not affect the height of “Add to Cart” then I’ve no problems in using this button on all pages.

    Appreciate your reply

    you can adjust the height of the button using css and height property. im not sure though if the selector is gonna work for you as i am using woocommerce.

    form.cart .single_add_to_cart_button {
    height: 20px !important; /*you can replace the value of 20 to the same height of the ‘Buy Now’ button*/
    }

    Hope this helps!

    • This reply was modified 3 years, 8 months ago by ivanpilien.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Quantity Button only on Cart Page’ is closed to new replies.