Помогите адаптировать пожалуйста JS чать
<?xml version="1.0" encoding="utf-8"?>
<modification>
<name>Опции в описании</name>
<version>1</version>
<link>site</link>
<author> </author>
<code>options</code>
<file path="catalog/controller/product/product.php">
<operation>
<search><![CDATA[$data['points'] = $product_info['points'];]]></search>
<add position="after"><![CDATA[$data['option_result'] = $this->language->get('text_option_result');]]></add>
</operation>
</file>
<file path="catalog/language/ru-ru/product/product.php">
<operation>
<search><![CDATA[$_['text_year'] = 'Год';]]></search>
<add position="after"><![CDATA[$_['text_option_result'] = 'Результат выбора:';]]></add>
</operation>
</file>
<file path="catalog/language/en-gb/product/product.php">
<operation>
<search><![CDATA[$_['text_year'] = 'year';]]></search>
<add position="after"><![CDATA[$_['text_option_result'] = 'Option result:';]]></add>
</operation>
</file>
<file path="catalog/view/theme/*/template/product/product.twig">
<operation>
<search><![CDATA[<input type="checkbox" name="option[{{ option.product_option_id }}][]" value="{{ option_value.product_option_value_id }}" />]]></search>
<add position="replace"><![CDATA[ <input type="checkbox" custom-name="{{ option_value.name }}" name="option[{{ option.product_option_id }}][]" value="{{ option_value.product_option_value_id }}" />]]></add>
</operation>
<operation>
<search><![CDATA[<input type="radio" name="option[{{ option.product_option_id }}]" value="{{ option_value.product_option_value_id }}" />]]></search>
<add position="replace"><![CDATA[ <input type="radio" name="option[{{ option.product_option_id }}]" custom-name=" {{ option_value.name }}" value="{{ option_value.product_option_value_id }}" />]]></add>
</operation>
<operation>
<search><![CDATA[{% if products %}]]></search>
<add position="before"><![CDATA[
<div class="col-lg-12">
<div class="options-results">
<h2>{{ option_result }}</h2>
<p class="optionResults" product-name="{{ heading_title }} "> {{ heading_title }} </p>
{% if price %}
<div style="float: right; display: flex;">
{% if special %}
<h2 class="price" style="margin: 0px; text-align: right; ">{{ price }}</h2>
{% else %}
<span class="price" style="text-decoration: line-through;margin: 0px; ">{{ price }}</span>
<h2 class="price" style="margin: 0px; text-align: right;">{{ special }}</h2>
{% endif %}
{% if tax %}
{{ text_tax }} {{ tax }}
{% endif %}
{% if discounts %}
<button type="button" id="bottom-button-cart" data-loading-text="{{ text_loading }}" class="btn btn-primary btn-lg btn-block">{{ button_cart }}</button>
</div>
{% endif %}
{% endif %}
</div>
</div>]]></add>
</operation>
<operation>
<search><![CDATA[{{ footer }} ]]></search>
<add position="before"><![CDATA[ <script>
// customer
$(document).ready(function() {
$("#bottom-button-cart").click(function() {
$("#button-cart").trigger('click');
});
});
$(document).ready(function() {
var hash = window.location.hash;
if (hash) {
var hashpart = hash.split('#');
var vals = hashpart[1].split('-');
for (i=0; i<vals.length; i++) {
$('#product').find('select option[value="'+vals[i]+'"]').attr('selected', true).trigger('select');
$('#product').find('input[type="radio"][value="'+vals[i]+'"]').attr('checked', true).trigger('click');
$('#product').find('input[type="checkbox"][value="'+vals[i]+'"]').attr('checked', true).trigger('click');
}
}
})
$(document).ready(function() {
var optionResults = [];
Array.prototype.remove = function() {
var what, a = arguments, L = a.length, ax;
while (L && this.length) {
what = a[--L];
while ((ax = this.indexOf(what)) !== -1) {
this.splice(ax, 1);
}
}
return this;
};
function setOptionResult(data)
{
var result = "";
if (data.attr("type") == "radio")
{
$("div[id^=input-" + data.attr("name").replace(/[\[\]]/g, "") + "] input").each(function () {
optionResults.remove($(this).attr('custom-name'));
});
}
if(data.is(':checked'))
{
if(!optionResults.includes(data.attr('custom-name')))
optionResults.push(data.attr('custom-name'));
}
else
{
optionResults.remove(data.attr('custom-name'));
}
optionResults.forEach(function(e) {
result += ", " + e ;
});
result = result.slice(0);
$(".optionResults").attr('product-name');
$('.optionResults').html($(".optionResults").attr('product-name') + result);
}
$('input[type="checkbox"]').bind('change', function() { setOptionResult($(this)); });
$('input[type="radio"]').bind('change', function() { setOptionResult($(this)); });
$('select option').bind('change', function() { setOptionResult($(this)); });
});
</script>
]]></add>
</operation>
</file>
</modification>