Author Topic: Basic Conversion Tracking  (Read 410 times)

marvays

  • Jr. Member
  • **
  • Posts: 102
    • http://marvays.cz
  • Skype Name: marvays
Basic Conversion Tracking
« on: May 21, 2018, 09:57:32 am »
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

Code: [Select]
<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>

marvays

  • Jr. Member
  • **
  • Posts: 102
    • http://marvays.cz
  • Skype Name: marvays
Re: Basic Conversion Tracking
« Reply #1 on: June 11, 2018, 22:25:59 pm »
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.

Code: [Select]
<?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>

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 7874
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: Basic Conversion Tracking
« Reply #2 on: June 12, 2018, 11:33:51 am »
U need to switch on full reporting to find the error but i suspect $html was not passed in the current object in VM2
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

marvays

  • Jr. Member
  • **
  • Posts: 102
    • http://marvays.cz
  • Skype Name: marvays
Re: Basic Conversion Tracking
« Reply #3 on: June 12, 2018, 12:44:30 pm »
grrrrrrrrr . . . . public $ error_reporting = 'maximum'; and nothing will appear> :(

marvays

  • Jr. Member
  • **
  • Posts: 102
    • http://marvays.cz
  • Skype Name: marvays
Re: Basic Conversion Tracking
« Reply #4 on: June 12, 2018, 21:21:24 pm »
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?