Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author ollybach

    (@ollybach)

    Hi
    Am away for a few days. Will post some code here when I get back

    Plugin Author ollybach

    (@ollybach)

    Hi

    you can do something like this in your functions.php (you might need to adjust a couple of bits depending on your exact scenario, but it should get you going)

    add_action('wp_footer', 'wppizza_required_onpickup',null,null);
    function wppizza_required_onpickup($field='ccustom6'){/*set ccustom6 to whatever field needs to be toggled*/
    		$isSelfPickup=!empty($_SESSION['wppizza']['selfPickup']) ? 1: 0;
    		echo"<script type='text/javascript'>
    			/* <![CDATA[ */
    			jQuery(document).ready(function($){
    				var wppizzaCfId = $('#".$field."');
    				var wppizzaCfLbl = $('label[for=\"".$field."\"]');
    				var wppizzaIsPickup = ".$isSelfPickup.";
    				if(wppizzaCfId.length>0 && wppizzaIsPickup==1){
    					wppizzaCfId.prop('required', false);
    					wppizzaCfLbl.prop('class','wppizza-order-label');
    				}
    			});
    			/* ]]> */
    		</script>";
    }

    Plugin Author ollybach

    (@ollybach)

    PS:
    i might even make that a clickable option of some sort (on a per order formfield basis) in the plugin in one of the next updates

    Thread Starter axelcopypast

    (@axelcopypast)

    Thank you! It helps me to distinguish fields pending on pickup settings.

    Plugin Author ollybach

    (@ollybach)

    version 2.8.9.10 now has an option (in order form settings) where you can selectively set which fields are also required(or not) on self pickup

    hope that helps

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘If pickup the order, then only telefon is needed in form’ is closed to new replies.