Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

opencar 2.2 и yandex ecommerce


Recommended Posts

Добрый гдень друзья, появилась задача настроить электронную коммерцию на сайте, полиил тутриал на янгдексе, всивил скрипт в футуре своего сайи:
 

<script type="text/javascript">
  window.dataLayer = window.dataLayer || [];
  window.dataLayer.push({
    "ecommerce": {
        "add": {
            "products": [
                {
                    "id": "<?php echo $product_id; ?>",
                    "name": "<?php echo $heading_title; ?>",
                    "price": "<?php if (!$special) { ?><?php echo $price; ?><?php } else { ?><?php echo $special; ?><?php } ?>",
                    "brand": "<?php echo $manufacturer; ?>",
                    "category": "<?php echo $category_info; ?>"
                }
            ]
        }
    }
});
</script>

Проверяю, и на переменные  $product_id; $heading_title; $category_info - ругается. PHP Notice:  Undefined variable. Почему не могу понять, куча всего перелиил перелисил не могу найти решения.
Использую opencart 2.2

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.