Home › Forums › Ticket Products › Event Tickets Plus › Disable quantity item in cart only for tickets
- This topic has 12 replies, 4 voices, and was last updated 9 years, 1 month ago by
Riccardo.
-
AuthorPosts
-
February 9, 2017 at 10:02 am #1232216
Riccardo
ParticipantHi,
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.
thanksFebruary 10, 2017 at 9:19 pm #1233212Cliff
MemberHi, 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.
February 11, 2017 at 5:43 am #1233321Riccardo
ParticipantHi Cliff,
I apply the first and second function … but it doesn’t work
thanksFebruary 11, 2017 at 5:56 am #1233322Riccardo
ParticipantMaybe it is helpful say I want disable the quantity selector in the cart before the checkout
thanksFebruary 11, 2017 at 9:24 pm #1233474Cliff
MemberPlease 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?
February 12, 2017 at 7:33 am #1233543Riccardo
ParticipantThis reply is private.
February 14, 2017 at 6:02 pm #1234897Cliff
MemberThis reply is private.
February 15, 2017 at 12:57 am #1235066Riccardo
ParticipantHi Cliff!
The quantity items in cart only for the tickets is disable, but I want to enable the item selector for the other elementsthanks
February 16, 2017 at 9:48 am #1238880Cliff
MemberRiccardo, I’m sorry but we can’t help with implementing such customizations, especially with a non-default WordPress theme (like Twenty Seventeen).
February 16, 2017 at 10:04 am #1238894Riccardo
ParticipantHi Cliff,
you have suggested a code, so I think you can help me for this problem
thanksFebruary 17, 2017 at 5:50 pm #1240593Cliff
MemberI 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.
March 11, 2017 at 8:35 am #1252890Support Droid
KeymasterHey 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 -
AuthorPosts
- The topic ‘Disable quantity item in cart only for tickets’ is closed to new replies.
