custom/plugins/BrandCrockWhatsappChat/src/Resources/views/storefront/base.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/base.html.twig' %}
  2. {% block base_scroll_up %}
  3.         {{parent()}}
  4.         {% sw_include '@Storefront/storefront/layout/whatsapp-chat.html.twig' %}
  5. {% endblock %}
  6.  
  7. {% block base_body_script %}
  8.  {{ parent() }}
  9.    <script type='text/javascript'>
  10. if(  typeof($) == 'undefined' ) {
  11.     document.write('<scr'+'ipt type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></scr'+'ipt>');
  12.  }
  13.  </script>
  14.  <script>
  15.      $(document).on("click", "#send-it", function () {
  16.         var a = document.getElementById("chat-input");
  17.         if(a.value !== ""){
  18.                 var b = $("#get-number").text();
  19.                 var x = $("#get-country-code").text();
  20.                 c = document.getElementById("chat-input").value;
  21.                 d = "https://web.whatsapp.com/send",
  22.                 e = b,
  23.                 f = "&text=" + c;
  24.             if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) var d = "whatsapp://send";
  25.             var g = d + "?phone=" + x + e + f;
  26.             $('#chat-input').val('');
  27.             window.open(g, '_blank')
  28.         }
  29.     }), 
  30.     $(document).on("click", ".informasi", function () {
  31.         document.getElementById("get-number").innerHTML = $(this).children(".my-number").text();
  32.         document.getElementById("get-country-code").innerHTML = $(this).children(".country-code").val();
  33.          $(".start-chat,.get-new").addClass("bcshow").removeClass("bchide"),
  34.          $(".home-chat,.head-home").addClass("bchide").removeClass("bcshow"), 
  35.          $(".back-chat").addClass("bcshow").removeClass("bchide"),
  36.          document.getElementById("get-nama").innerHTML = $(this).children(".info-chat").children(".chat-nama").text(), 
  37.          document.getElementById("get-label").innerHTML = $(this).children(".info-chat").children(".chat-label").text(),
  38.          document.getElementById("get-avatar").src = $(this).children(".info-chat").children(".chat-avatar").val()
  39.     }), 
  40.     $(document).on("click", ".close-chat", function () {
  41.         $("#whatsapp-chat").addClass("bchide").removeClass("bcshow")
  42.     }), 
  43.     $(document).on("click", ".back-chat", function () {    
  44.         $(".start-chat,.get-new").addClass("bchide").removeClass("bcshow"),
  45.         $(".home-chat,.head-home").addClass("bcshow").removeClass("bchide"), 
  46.         $(".back-chat").addClass("bchide").removeClass("bcshow"),
  47.         $("#whatsapp-chat").addClass("bcshow").removeClass("bchide")
  48.     }),
  49.     $(document).on("click", ".notification", function () {
  50.         $("#whatsapp-chat").addClass("bcshow").removeClass("bchide")
  51.     });
  52.  </script>
  53. {% endblock %}