bongzilla

Untitled

Dec 21st, 2020
877
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $prices = get_option( "custom_settings" );
  3.  
  4. function checkSiteLang() {
  5.     $path = parse_url($_SERVER["REQUEST_URI"]);
  6.     $lang = strpos($path["path"], "en");
  7.     return $lang != false ? "en" : ru;
  8. }
  9.  
  10. function showPriceBasedOnLang(price) {
  11.  
  12.     if(checkSiteLang() === "ru") {
  13.         if(get_sub_field("ajdi_cena") == "price-kit-start") {
  14.             echo $prices["kit_price_1"];
  15.         } elseif (get_sub_field("ajdi_cena") == "price-kit-standard") {
  16.             echo $prices["kit_price_2"];
  17.         } elseif (get_sub_field("ajdi_cena") == "price-kit-full") {
  18.             echo $prices["kit_price_3"];
  19.         } elseif (get_sub_field("ajdi_cena") == "price-kit-maker") {
  20.             echo $prices["kit_price_4"];
  21.         }
  22.     } else if(checkSiteLang() === "en") {
  23.         if(get_sub_field("ajdi_cena") == "price-kit-start") {
  24.             echo $prices["kit_price_converted_1"];
  25.         } elseif (get_sub_field("ajdi_cena") == "price-kit-standard") {
  26.             echo $prices["kit_price_converted_2"];
  27.         } elseif (get_sub_field("ajdi_cena") == "price-kit-full") {
  28.             echo $prices["kit_price_converted_3"];
  29.         } elseif (get_sub_field("ajdi_cena") == "price-kit-maker") {
  30.             echo $prices["kit_price_converted_4"];
  31.         }
  32.     }
  33.  
  34. }
  35. ?>
  36.  
  37.  
RAW Paste Data