Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Подключение подсказок к Simpla CMS

Инструкция по подключению подсказок DaData.ru к Simpla CMS

  1. Внизу файла cart.tpl добавляем:

     {literal}
     <link href="https://cdn.jsdelivr.net/npm/suggestions-jquery@latest/dist/css/suggestions.min.css" rel="stylesheet" />
     <script src="https://cdn.jsdelivr.net/npm/suggestions-jquery@latest/dist/js/jquery.suggestions.min.js"></script>
     <script>
         $(".cart_form input[name='name']").suggestions({
             token: "ВАШ API-КЛЮЧ",
             type: "NAME",
             params: {
                 parts: ["NAME", "SURNAME"]
             }
         });
         $(".cart_form input[name='address']").suggestions({
             token: "ВАШ API-КЛЮЧ",
             type: "ADDRESS"
         });
     </script>
     {/literal}
     
  2. Вместо «ВАШ API-КЛЮЧ» пишем свой ключ (получить можно на https://dadata.ru/suggestions, это бесплатно).

  3. Все работает!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment