tracking code to heureka page

  • Posts: 15
  • Thank you received: 0
  • Hikashop Essential
3 weeks 3 days ago #313333

-- HikaShop version -- : 4.2.2
-- Joomla version -- : 3.9.8
-- PHP version -- : 7.2.7
-- Browser(s) name and version -- : chrome

Hello,

can You please help me with implementing tracking code to hikashop?
As I find out, it should go in view end.php
code should look like:

<?php
require_once __DIR__ . '/../vendor/autoload.php';
try {
// Use your own API key here. And keep it secret!
$apiKey = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
$options = [
// Use \Heureka\ShopCertification::HEUREKA_SK if your e-shop is on heureka.sk
'service' => \Heureka\ShopCertification::HEUREKA_SK,
];
$shopCertification = new \Heureka\ShopCertification($apiKey, $options);
// Set customer email - it is MANDATORY.
$shopCertification->setEmail('This email address is being protected from spambots. You need JavaScript enabled to view it.');
// Set order ID - it helps you track your customers' orders in Heureka shop administration.
$shopCertification->setOrderId(1597884);

// And finally send the order to our service.
$shopCertification->logOrder();
// Everything went well - we are done here.

I need to import in this code user mail who created the order and also order number

Please Log in or Create an account to join the conversation.

  • Posts: 67676
  • Thank you received: 10046
  • MODERATOR
3 weeks 2 days ago #313338

Hi,

The order id is available in $this->order->order_id and the email is available in $this->order->customer->user_email
in the view file checkout / end.php

Please Log in or Create an account to join the conversation.

  • Posts: 15
  • Thank you received: 0
  • Hikashop Essential
3 weeks 2 days ago #313369

Thank You for Your replay
I implemented it like this:

<?php
require_once __DIR__ . '/../vendor/autoload.php';
try {
// Use your own API key here. And keep it secret!
$apiKey = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx';
$options = [
// Use \Heureka\ShopCertification::HEUREKA_SK if your e-shop is on heureka.sk
'service' => \Heureka\ShopCertification::HEUREKA_SK,
];
$shopCertification = new \Heureka\ShopCertification($apiKey, $options);
// Set customer email - it is MANDATORY.
$shopCertification->setEmail('$this->order->customer->user_email');
// Set order ID - it helps you track your customers' orders in Heureka shop administration.
$shopCertification->setOrderId($this->order->order_id);

// And finally send the order to our service.
$shopCertification->logOrder();
// Everything went well - we are done here.


but get this error:
Warning: require_once(/www/e/n/u123817/public_html/libraries/joomla/document/html/renderer/head.php): failed to open stream: No such file or directory in /www/e/n/u123817/public_html/templates/sj_thecool_free/error.php on line 44

Fatal error: require_once(): Failed opening required '/www/e/n/u123817/public_html/libraries/joomla/document/html/renderer/head.php' (include_path='.:/usr/local/php72/lib/php') in /www/e/n/u123817/public_html/templates/sj_thecool_free/error.php on line 44

I am not programmer and dont know what is wrong

I would be gratefull if You can help me

thank You

Please Log in or Create an account to join the conversation.

  • Posts: 67676
  • Thank you received: 10046
  • MODERATOR
3 weeks 1 day ago #313377

Hi,

That error comes from your template. I would recommend to contact your template provider about it.
What I can propose to fix it temporarily is to rename that error.php file from your template via FTP and copy the error.php file from the protostar template there. That should hopefully avoid the problem.

Please Log in or Create an account to join the conversation.

Time to create page: 0.053 seconds
Powered by Kunena Forum