News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Basic Conversion Tracking

Started by marvays, May 21, 2018, 09:57:32 AM

Previous topic - Next topic

marvays

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>

marvays

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>

GJC Web Design

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 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

marvays

grrrrrrrrr . . . . public $ error_reporting = 'maximum'; and nothing will appear> :(

marvays

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?