E
E
Evgeny Osipov2020-07-21 17:49:28
1C-Bitrix
Evgeny Osipov, 2020-07-21 17:49:28

How to insert a form from amoCRM and remove caching?

I'm trying to add a code from amoCRM to the product card in template.php that displays a button and an iframe form in a modal window:

<script>var amo_forms_params = {"id":XXXXXX,"hash":"XXXXXXXXXXXXXXX","locale":"ru"};</script>
<script id="amoforms_script" async="async" charset="utf-8" src="https://forms.amocrm.ru/forms/assets/js/amoforms.js"></script>

If you add code to template.php, then the form is displayed once, after that the component is cached and the iframe disappears, the modal window disappears.

If you place the code in component_epilog.php then the form works.
By design should be placed in template.php

How to solve this problem?
Nobody faced it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Emelyanov, 2020-07-22
@babarun

And show the code, as you embedded in template.phpthe html code, before and after caching.
Very strange behavior, getting scripts into the cache should not affect them in any way. Shouldn't you move all scripts to the end of the page in the settings of the main module?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question