Здравствуйте, подскажите почему не работает? В контролер success.php добавил эту часть кода для гугл аналитикс
$data['order_id'] = $this->session->data['order_id'];
$data['total'] = $this->currency->reformat($this->cart->getTotal(), $this->config->get('config_currency'));
$products = $this->cart->getProducts();
$my_feeds = array();
if ($products) {
foreach ($products as $product) {
$my_feeds[] = array(
'name' => html_entity_decode($product['name'], ENT_QUOTES, 'UTF-8'),
'sku' => (empty($result['sku'])) ? '' : $this->language->get('text_sku') .' '. $result['sku'],
'text' => $category_info['name'],
'price' => $this->currency->reformat($product['price'], $this->config->get('config_currency')),
'quantity' => $product['quantity']
);
}
}
$data['feeded'] = $my_feeds;
и это уже в самом шаблоне
<script>
dataLayer = [{
'transactionId': "{{ order_id }}",
'transactionTotal': "{{ total }}",
'transactionProducts': [
{% for key, item in feeded %}
{
'name': '{{ item.name }}',
'sku': '{{ sku }}',
'categores': '{{categores}}',
'price': '{{ item.price }}',
'quantity': '{{ item.quantity }}',
}{% if key < (feeded|length - 1) %},{% endif %}
{% endfor %}
]
}];
</script>
вроде всё правильно сделал, но поля ску и категория пустые