israel phone number regex

//cellular israeli regex
/^05\d([-]{0,1})\d{7}$/

//all numbers israel
/^0\d([\d]{0,1})([-]{0,1})\d{7}$/

Update one Regex for all Isrealy numbers

^\+?(972|0)(\-)?0?(([23489]{1}\d{7})|[5]{1}\d{8})$

Advertisements

opencart current url

the seo guy requested to add link to current url to each H1 in the site so i found this code to do this


  <?php  $url = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; ?>
  <h1><a href="<?php echo $url; ?>"><?php echo $heading_title; ?></a></h1>

passing parameters to iframe inside wordpress page

i wanted to move two inputs data to iframe in other page in the same site this is what i did

first in the home page i added a form and added this code

 

<input type="submit" class="wpcf7-form-control wpcf7-submit" value="submit"  onclick="createNewContract();return false;" >

function createNewContract() {

location.href = 'http://webstie.com form/'+'?townId='+document.getElementById("townId").value+'&wasteAmount='+document.getElementById("wasteAmount").value;
}

making new option value column from 2 columns

i have this excel file which contains 2 columns of city names and city code i wanted to make from this 2 columns a new column with this  code

<option value=960>city name </option>

and i found this useful formula (thanks to jamal)

=CONCATENATE(“<option value=”,A2,”>”,B2,”</option>”)

when u put this code in the new column and copy them to the rest of the rows by pressing twice on the + sign .

woocommerce remove fields from checkout

well it is called “Customizing checkout fields using actions and filters”

what u need to do is to add this code in functions.php and u r done , you need to choose what you want to unset

 
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
  
function custom_override_checkout_fields( $fields ) {
	
unset($fields['billing']['billing_first_name']);
unset($fields['billing']['billing_last_name']);
unset($fields['billing']['billing_company']);
unset($fields['billing']['billing_address_1']);
unset($fields['billing']['billing_address_2']);
unset($fields['billing']['billing_city']);
unset($fields['billing']['billing_postcode']);
unset($fields['billing']['billing_country']);
unset($fields['billing']['billing_state']);
unset($fields['billing']['billing_phone']);
unset($fields['order']['order_comments']);
unset($fields['billing']['billing_email']);
unset($fields['account']['account_username']);
unset($fields['account']['account_password']);
unset($fields['account']['account_password-2']);
 
    return $fields;
}