I want to add a line of you to the Facebook script when users complete a purchase. Since OpenCart loads same header on all of the pages, I need to somehow find out if the order is completed and success.tpl is loaded, add and extra line to the Facebook pixel.
I have added the following code (used from one other post I saw in the forum) to the header.php:
Code: Select all
if (!empty($this->request->get['route'])) {
$data['route'] = $this->request->get['route'];
} else {
$data['route'] = '';
}
Code: Select all
<?php if (!empty($route) && $route == 'checkout/success') { ?>
// The extra line has been added here
<?php } ?>
Thanks,