Disable quantity item in cart only for tickets

Home Forums Ticket Products Event Tickets Plus Disable quantity item in cart only for tickets

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1232216
    Riccardo
    Participant

    Hi,
    it’s possible to disable the quantity items in cart only for the tickets?


    function mse_wc_cart_item_quantity( $product_quantity, $cart_item_key, $cart_item ){
    $product_id = $cart_item['product_id'];

    $cart_item = WC()->cart->cart_contents[ $cart_item_key ];
    $product_quantity = $cart_item[‘quantity’];

    return $product_quantity;
    }

    add_filter( ‘woocommerce_cart_item_quantity’, ‘mse_wc_cart_item_quantity’, 10, 3 );

    with this code I disable for all items , because if someone added a ticket in the cart doesn’t fill the required fields.
    thanks

    #1233212
    Cliff
    Member

    Hi, Riccardo.

    I believe this is exactly what you asked for:

    https://gist.github.com/cliffordp/66bf05df61ee269c60ff20d6f39e2cab

    Or this might be a different way to handle your situation:

    https://gist.github.com/cliffordp/f148a9cacd726e5a86ffeda2d2e204c1

    Please let me know how this goes for you.

    #1233321
    Riccardo
    Participant

    Hi Cliff,
    I apply the first and second function … but it doesn’t work
    thanks

    #1233322
    Riccardo
    Participant

    Maybe it is helpful say I want disable the quantity selector in the cart before the checkout
    thanks

    #1233474
    Cliff
    Member

    Please provide a link to the page from your screenshot–the page where you want the quantity to be readonly (i.e. not editable).

    Also, do you want this to be the same behavior for all tickets or only this one event’s?

    #1233543
    Riccardo
    Participant

    This reply is private.

    #1234897
    Cliff
    Member

    This reply is private.

    #1235066
    Riccardo
    Participant

    Hi Cliff!
    The quantity items in cart only for the tickets is disable, but I want to enable the item selector for the other elements

    thanks

    #1238880
    Cliff
    Member

    Riccardo, I’m sorry but we can’t help with implementing such customizations, especially with a non-default WordPress theme (like Twenty Seventeen).

    #1238894
    Riccardo
    Participant

    Hi Cliff,
    you have suggested a code, so I think you can help me for this problem
    thanks

    #1240593
    Cliff
    Member

    I appreciate your question and the desire to customize it for your use. However, we do not provide in-depth customization help, per our Scope of Support / Terms.

    I’ve provided you with a couple snippets that may assist with what you’re wanting, but if it isn’t working for you or you’re wanting something slightly different, you might need to do some troubleshooting on your site (e.g. test the snippet(s) with Twenty Seventeen theme and/or all other plugins disabled), or you may need to tweak the code to suit your site.

    Thank you very much for your understanding.

    If you need some coding help, you may want to ask your developer or reference our documentation and list of known customizers.

    #1252890
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Disable quantity item in cart only for tickets’ is closed to new replies.