Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function get_mobile_price(){
- global $post;
- $prices = get_field('prices', $post->ID);
- $default_price = get_field('default_price', $post->ID);
- $i = 0;
- $mobile_price = '';
- // Get server URI
- $country = explode('/', $_SERVER['REQUEST_URI']) [1];
- foreach ($prices as $price) {
- //var_dump($price['country']->post_name);
- if($country == $price['country']->post_name){
- echo $price['price'];
- break;
- }else{
- echo $default_price;
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement