Thread Starter
durabo
(@durabo)
Hi solved it by adding this css:
#wbk-book-quantity option:not([value=”1″]):not([value=”2″]){
display: none !important;
}
Hi,
Thank you for sharing your solution, but it may not work on certain iOS devices. I would recommend using the following custom JavaScript code:
function wbk_on_form_rendered( service ){
jQuery('#wbk-book-quantity').find('option').remove();
jQuery('#wbk-book-quantity').html('<option value="1">1</option><option value="2">2</option>');
}
If your theme doesn’t support custom javascript, you can add this code using plugin Simple Custom CSS and JS
If you have any question, feel free to contact us.
Thread Starter
durabo
(@durabo)
What if I only need to block a particular service?
I have 3 services. On two I have to block the items to max 2, while on one service I have to block the items to max 1.
-
This reply was modified 4 years, 9 months ago by
durabo.
You need to update the custom code, so there will be different behavior depending on the service ID.
In the following example, it allows 2 places for the service with the ID 1, and 1 place for the service with the ID 1:
function wbk_on_form_rendered( service ){
jQuery('#wbk-book-quantity').find('option').remove();
if( serrvice == 1 ){
jQuery('#wbk-book-quantity').html('<option value="1">1</option><option value="2">2</option>');
}
if( serrvice == 2 ){
jQuery('#wbk-book-quantity').html('<option value="1">1</option>');
}
}