News:

Looking for documentation? Take a look on our wiki

Main Menu

Adding facebook script to virtuemart thank you page.

Started by Sheepiss, July 31, 2015, 10:00:47 AM

Previous topic - Next topic

Sheepiss

Hi everyone,

my e-shop is running on Joomla! 3.4.1 - VirtueMart 3.0.6.4.

I have installed component VM UIKit on YOOtheme template.

I would like to add facebook script (pixel) to the thank you page, which is on my opinion located in: /www/templates/my_theme/html/com_virtuemart/cart/order_done.php

Actual content of the file order_done.php is:
<?php // no direct access
defined('_JEXEC') or die;

/**
 * Theme: VirtueMart Theme
 *
 * @package      FrontEnd / Template
 * @author      MoWebSo.com / Eugen Stranz
 * @copyright       (C) 2009 - 2013 ENYtheme e.K.
 * @license     GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html
 */

// Include The MoWebSo Library 
require_once("components/com_vmuikit/libraries/joomla/thirdparty/virtuemart.php");
$vmuikitlib VmuikitVirtuemart::getInstance(); 


// Include The Right Start File For The Chosen Theme
$this->addTemplatePath(JPATH_SITE '/templates/' $vmuikitlib->templateName '/html/com_virtuemart/themes/' $vmuikitlib->themeName '/checkout/');
echo 
$this->loadTemplate('start');
//echo $vmuikitlib->getFooterText();
$vmuikitlib->headerdata();


Facebook script looks like this:
<!-- Facebook Conversion Code for Zákazníci, kteří nakoupili -->
<script>(function() {
var _fbq = window._fbq || (window._fbq = []);
if (!_fbq.loaded) {
var fbds = document.createElement('script');
fbds.async = true;
fbds.src = '//connect.facebook.net/en_US/fbds.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(fbds, s);
_fbq.loaded = true;
}
})();
window._fbq = window._fbq || [];
window._fbq.push(['track', '6025561659922', {'value':'0.00','currency':'CZK'}]);
</script>
<noscript><img height="1" width="1" alt="" style="display:none" src="https://www.facebook.com/tr?ev=6025561659922&cd[value]=0.00&cd[currency]=CZK&noscript=1" /></noscript>


I dont know where exactly to add this facebook script code or how to modify the files to run it correctly.

Thanks for any advice.

Sheepiss

GJC Web Design

 just echo it out on the order_done.php file -- it is just javascript that needs to be printed

you'll have to see what is available in the $this object to see if you can get the value
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Sheepiss

Can you advice me how exactly to do it? I am not a programmer and dont understand what you answered. How to echo it out on the order_done.php file? And what should exactly be in the $this object?

Sorry for my ignorance.

Thanks, Sheepiss

GJC Web Design

Afraid house calls need to be paid for.. PM if interested
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation