<?php exec('ffmpeg -i sample.mp4 -i logo.png -filter_complex "overlay=10:10",drawbox="y=ih-h-20:color=black@0.4:width= iw:height=48:t=fill",drawtext= "fontfile=OpenSans-Bold.ttf: text=Gurpreet | 9876534566: fontcolor=white: fontsize=30: x=(w-text_w)/2: y=(h-text_h)-30" -codec:a copy output_video.mp4 ') ?>
Category: WORDPRESS
How to remove checkout fields from specific products in checkout page
add_filter( 'woocommerce_checkout_fields' , 'hide_checkout_fields' ); function hide_checkout_fields( $fields ) { foreach( WC()->cart->get_cart() as $cart_item_key => $cart_item ) { $product = $cart_item['data']; $id = $product->get_id(); $products = array(2516, 584, 2454); // Product Ids if (in_array($id, $products)) { unset($fields['order']['how_heard']); unset($fields['order']['member_level']); } } return $fields; }
How to add cookies for popup in cart and checkout page
<?php if (is_cart() || is_checkout()) { ?> <script src="https://sitename.com/jquery.exitintent.js"></script> <script src="https://sitename.com/jquerysession.js"></script> <script type="text/javascript"> function getCookie(cname) { var name = cname + "="; var decodedCookie = decodeURIComponent(document.cookie); var ca = decodedCookie.split(';'); for(var i = 0; i <ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; } var username = getCookie("cname"); if (username == "kook") { }else{ jQuery(function() { jQuery.exitIntent('enable'); jQuery(document).bind('exitintent', function() { jQuery("#warning").slideDown(); }); jQuery("#warning a").bind('click', function(){ var now = new Date(); var time = now.getTime(); time += 3600 * 1000; now.setTime(time); document.cookie = 'cname=' + 'kook' + '; expires=' + now.toUTCString() + '; path=/'; jQuery("#warning").slideUp(); location.reload(); }); }); } </script> <?php }else{ }?>