September 21, 2016

How to get latitude & longitude from address or postcode string

function address_to_lat_lng($address){
$ret = array();
$address = urlencode($address);
$url = "http://maps.google.com/maps/api/geocode/json?address=$address&sensor=false";
//pree($url);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_PROXYPORT, 3128);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$response = curl_exec($ch);
curl_close($ch);
//pree($response);
$response_a = json_decode($response);
$ret['lat'] = $response_a->results[0]->geometry->location->lat;
$ret['lng'] = $response_a->results[0]->geometry->location->lng;
return $ret;
}

Last updated: September 21, 2016
August 29, 2016

s2member

Setup WooCommerce Discounts and link with s2Member user roles/level:

How it works?

  1. Create membership levels with s2member > Membership Levels/Labels.  | Video Tutorial
  2. If membership levels are created already so you will have them in “Membership Level” dropdown here (on this page, see left). Now select Discount Type either fixed price discount or percentage discount.
  3. Now you will notice that these membership levels are appearing with either your selected currency symbol £ or percentage % symbol. Select membership level and define discount criteria.
  4. Save changes and try discounts in your cart according to the membership level of logged in user. For more support, contact here.
Video Tutorials:

  1. Overview:
  2. Discounts with s2member

WooCommerce Discounts Plus

and
s2member

WooCommerce Discounts Plus (Pro)+ s2Member (Pro) Settings

Last updated: August 31, 2016