Hello. I have a code for conversion tracking. In the code are two unknown (order number and order price) which I need after finishing the odelsat to the server.
How to modify the code to work?
Virtuemart 2 and joomla 2.5
<script>
(function(w,d,s,u,n,k,c,t){w.ZboziConversionObject=n;w[n]=w[n]||function(){
(w[n].q=w[n].q||[]).push(arguments)};w[n].key=k;c=d.createElement(s);
t=d.getElementsByTagName(s)[0];c.async=1;c.src=u;t.parentNode.insertBefore(c,t)
})(window,document,"script","https://www.zbozi.cz/conversion/js/conv.js","zbozi","60035");
zbozi("setOrder",{
"orderId": "OBJ2016-01-01",
"totalPrice": "5140.00"
});
zbozi("send");
</script>
hi again. I was solved this code. but have new problem. I have solution for VM3. But, i need retype it for VM2. Can anyone help me please? When i use this code for vm2, i see blank page after done order.
<?php
defined('_JEXEC') or die('');
/**
*
* Template for the shopping cart
*
* @package VirtueMart
* @subpackage Cart
* @author Max Milbers
*
* @link http://www.virtuemart.net
* @copyright Copyright (c) 2004 - 2010 VirtueMart Team. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
*/
echo "<h3>".JText::_('COM_VIRTUEMART_CART_ORDERDONE_THANK_YOU')."</h3>";
echo $this->html;
$cart = VirtueMartCart::getCart();
$currencyDisplay = CurrencyDisplay::getInstance();
$ID_OBCHODU = '118583';
$CISLO_OBJEDNAVKY = $cart->orderDetails['details']['BT']->order_number;
$HODNOTA_OBJEDNAVKY = $currencyDisplay->roundForDisplay($cart->orderDetails['details']['BT']->order_total);
?>
<script>
(function(w,d,s,u,n,k,c,t){w.ZboziConversionObject=n;w[n]=w[n]||function(){
(w[n].q=w[n].q||[]).push(arguments)};w[n].key=k;c=d.createElement(s);
t=d.getElementsByTagName(s)[0];c.async=1;c.src=u;t.parentNode.insertBefore(c,t)
})(window,document,"script","https://www.zbozi.cz/conversion/js/conv.js","zbozi","<?= $ID_OBCHODU ?>");
zbozi("setOrder",{
"orderId": "<?= $CISLO_OBJEDNAVKY; ?>",
"totalPrice": "<?= $HODNOTA_OBJEDNAVKY; ?>"
});
zbozi("send");
</script>
U need to switch on full reporting to find the error but i suspect $html was not passed in the current object in VM2
grrrrrrrrr . . . . public $ error_reporting = 'maximum'; and nothing will appear> :(
ok. error code havent.
i need know order-id and total price?
for vm2 work:
$CISLO_OBJEDNAVKY = $cart->orderDetails['details']['BT']->order_number;
$HODNOTA_OBJEDNAVKY = $currencyDisplay->roundForDisplay($cart->orderDetails['details']['BT']->order_total);
. . . and this i give to the code.
What work for VM2?