Advertisement
qdubois

Prestashop Googel Analytics For Webgain

Oct 14th, 2012
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 20.44 KB | None | 0 0
  1. <?php
  2. /*
  3. * 2007-2012 PrestaShop
  4. *
  5. * NOTICE OF LICENSE
  6. *
  7. * This source file is subject to the Academic Free License (AFL 3.0)
  8. * that is bundled with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://opensource.org/licenses/afl-3.0.php
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@prestashop.com so we can send you a copy immediately.
  14. *
  15. * DISCLAIMER
  16. *
  17. * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
  18. * versions in the future. If you wish to customize PrestaShop for your
  19. * needs please refer to http://www.prestashop.com for more information.
  20. *
  21. *  @author PrestaShop SA <contact@prestashop.com>
  22. *  @copyright  2007-2011 PrestaShop SA
  23. *  @version  Release: $Revision: 16479 $
  24. *  @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
  25. *  International Registered Trademark & Property of PrestaShop SA
  26. */
  27.  
  28. if (!defined('_PS_VERSION_'))
  29.     exit;
  30.  
  31. class GAnalytics extends Module
  32. {
  33.     function __construct()
  34.     {
  35.         $this->name = 'ganalytics';
  36.         $this->tab = 'analytics_stats';
  37.         $this->version = '1.4.1';
  38.         $this->author = 'PrestaShop';
  39.         $this->displayName = 'Google Analytics';
  40.         $this->module_key = 'fd2aaefea84ac1bb512e6f1878d990b8';
  41.  
  42.         parent::__construct();
  43.  
  44.         if ($this->id AND !Configuration::get('GANALYTICS_ID'))
  45.             $this->warning = $this->l('You have not yet set your Google Analytics ID');
  46.         $this->description = $this->l('Integrate Google Analytics script into your shop');
  47.         $this->confirmUninstall = $this->l('Are you sure you want to delete your details ?');
  48.  
  49.         /** Backward compatibility */
  50.         require(_PS_MODULE_DIR_.$this->name.'/backward_compatibility/backward.php');
  51.     }
  52.  
  53.     function install()
  54.     {
  55.         if (!parent::install() ||
  56.                 !$this->registerHook('header') ||
  57.                 !$this->registerHook('orderConfirmation'))
  58.             return false;
  59.         return true;
  60.     }
  61.  
  62.     function uninstall()
  63.     {
  64.         if (!Configuration::deleteByName('GANALYTICS_ID') || !parent::uninstall())
  65.             return false;
  66.         return true;
  67.     }
  68.  
  69.     public function getContent()
  70.     {
  71.         $output = '<h2>Google Analytics</h2>';
  72.         if (Tools::isSubmit('submitGAnalytics') AND ($gai = Tools::getValue('ganalytics_id')))
  73.         {
  74.             Configuration::updateValue('GANALYTICS_ID', $gai);
  75.             $output .= '
  76.             <div class="conf confirm">
  77.                 <img src="../img/admin/ok.gif" alt="" title="" />
  78.                 '.$this->l('Settings updated').'
  79.             </div>';
  80.         }
  81.        
  82.        
  83.         if (Tools::isSubmit('submitWG') AND ($wgevid = Tools::getValue('wg_event_id'))
  84.         AND ($wgpin = Tools::getValue('wg_pin')) AND ($wgpgmid = Tools::getValue('wg_pgm_id'))
  85.         )
  86.         {
  87.             Configuration::updateValue('WG_EVENT_ID', $wgevid);
  88.             Configuration::updateValue('WG_PGM_ID', $wgpgmid);
  89.             Configuration::updateValue('WG_PIN', $wgpin);
  90.             $output .= '
  91.             <div class="conf confirm">
  92.                 <img src="../img/admin/ok.gif" alt="" title="" />
  93.                 '.$this->l('Settings updated').'
  94.             </div>';
  95.         }
  96.        
  97.         if (Tools::isSubmit('removeOrder') AND ($oid = Tools::getValue('order_id'))){
  98.             $message = 'Order Removed from GA : ';
  99.             $order = new Order((int)$oid);
  100.            
  101.            
  102.            
  103.             if (!$order->id_address_delivery){
  104.                 $message = 'BAD ORDER NUMBER : ';
  105.             }else{
  106.                
  107.                 $deliveryAddress = new Address(intval($order->id_address_delivery));
  108.  
  109.                 $conversion_rate = 1;
  110.                 if ($order->id_currency != Configuration::get('PS_CURRENCY_DEFAULT'))
  111.                 {
  112.                     $currency = new Currency(intval($order->id_currency));
  113.                     $conversion_rate = floatval($currency->conversion_rate);
  114.                 }
  115.                
  116.                 // Order general information
  117.                 $trans = array(
  118.                         'id' => intval($order->id),             // order ID - required
  119.                         //'store' => htmlentities(Configuration::get('PS_SHOP_NAME')), // affiliation or store name
  120.                         'store' => preg_replace('/[\'\x00-\x1F\x80-\xFF]/',' ', Configuration::get('PS_SHOP_NAME')),
  121.                         'total' => Tools::ps_round(floatval($order->total_paid) / floatval($conversion_rate), 2),       // total - required
  122.                         'tax' => '0', // tax
  123.                         'shipping' => Tools::ps_round(floatval($order->total_shipping) / floatval($conversion_rate), 2),    // shipping
  124.                         'city' => addslashes($deliveryAddress->city),       // city
  125.                         'state' => '',              // state or province
  126.                         'country' => addslashes($deliveryAddress->country) // country
  127.                         );
  128.  
  129.                
  130.                
  131.                 $products = $order->getProducts();
  132.                 foreach ($products AS $product)
  133.                 {
  134.                     $category = Db::getInstance()->getRow('
  135.                                     SELECT name FROM `'._DB_PREFIX_.'category_lang` , '._DB_PREFIX_.'product
  136.                                     WHERE `id_product` = '.intval($product['product_id']).' AND `id_category_default` = `id_category`
  137.                                     AND `id_lang` = '.intval($parameters['PS_LANG_DEFAULT']));
  138.    
  139.                     $items[] = array(
  140.                         'OrderId' => intval($order->id),                                // order ID - required
  141.                                     'SKU' => addslashes($product['product_id']),        // SKU/code - required
  142.                                     'Product' => addslashes($product['product_name']),      // product name
  143.                                     'Category' => addslashes($category['name']),            // category or variation
  144.                                     'Price' => Tools::ps_round(floatval($product['product_price_wt']) / floatval($conversion_rate), 2), // unit price - required
  145.                                     'Quantity' => addslashes(intval($product['product_quantity']))  //quantity - required
  146.                                     );
  147.                 }
  148.                 $ganalytics_id = Configuration::get('GANALYTICS_ID');
  149.                 /*print_r($trans);
  150.                 print_r($products);*/
  151.                
  152.                 $script = '';
  153.                
  154.                 $script .= '
  155.                     var _gaq = _gaq || [];
  156.                     _gaq.push([\'_setAccount\', \''.$ganalytics_id.'\']);
  157.                     // Recommanded value by Google doc and has to before the trackPageView
  158.                     _gaq.push([\'_setSiteSpeedSampleRate\', 5]);
  159.        
  160.                       _gaq.push([\'_addTrans\',
  161.                         \''.$trans["id"].'\',            
  162.                         \''.$trans["store"].'\',         
  163.                         \'-'.$trans["total"].'\',    
  164.                         \'-'.$trans["tax"].'\',          
  165.                         \'-'.$trans["shipping"].'\',     
  166.                         \''.$trans["city"].'\',      
  167.                         \''.$trans["state"].'\',         
  168.                         \''.$trans["country"].'\'        
  169.                       ]);
  170.                    
  171.                       ';
  172.                      
  173.                     foreach ($items AS $item)
  174.                     {
  175.                          $script .= '_gaq.push([\'_addItem\',
  176.                                 \''.$item["OrderId"].'\',        
  177.                                 \''.$item["SKU"].'\',            
  178.                                 \''.$item["Product"].'\',        
  179.                                 \''.$item["Category"].'\',       
  180.                                 \'-'.$item["Price"].'\',         
  181.                                 \'-'.$item["Quantity"].'\'       
  182.                             ]);';
  183.              
  184.                     }
  185.                  
  186.                  $script .= ' _gaq.push([\'_trackTrans\']);';
  187.                  
  188.                  
  189.                  $script .= '
  190.                     (function() {
  191.                         var ga = document.createElement(\'script\'); ga.type = \'text/javascript\'; ga.async = true;
  192.                         ga.src = (\'https:\' == document.location.protocol ? \'https://ssl\' : \'http://www\') + \'.google-analytics.com/ga.js\';
  193.                         var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(ga, s);
  194.                     })();
  195.                 ';             
  196.             }
  197.            
  198.             $output .= '
  199.             <div class="conf confirm">
  200.                 <script type="text/javascript">
  201.                     '.$script.'
  202.                 </script>
  203.                 <img src="../img/admin/ok.gif" alt="" title="" />
  204.                 <p>'.$script.'</p>
  205.                 <p>'.$message.$oid.'</p>
  206.             </div>';   
  207.         }
  208.        
  209.         return $output.$this->displayForm();
  210.     }
  211.    
  212.  
  213.     public function displayForm()
  214.     {
  215.         $output = '
  216.         <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
  217.             <fieldset class="width2">
  218.                 <legend><img src="../img/admin/cog.gif" alt="" class="middle" />'.$this->l('Settings').'</legend>
  219.                 <label>'.$this->l('Your username').'</label>
  220.                 <div class="margin-form">
  221.                     <input type="text" name="ganalytics_id" value="'.Tools::safeOutput(Tools::getValue('ganalytics_id', Configuration::get('GANALYTICS_ID'))).'" />
  222.                     <p class="clear">'.$this->l('Example:').' UA-1234567-1</p>
  223.                 </div>
  224.                 <center><input type="submit" name="submitGAnalytics" value="'.$this->l('Update ID').'" class="button" /></center>
  225.             </fieldset>
  226.         </form>';
  227.        
  228.        
  229.         $output .= '
  230.         <p>&nbsp;</p>
  231.         <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
  232.             <fieldset class="width2">
  233.                 <legend><img src="../img/admin/cog.gif" alt="" class="middle" />WEB GAIN</legend>
  234.                 <label>WebGain Event Id</label>
  235.                 <div class="margin-form">
  236.                     <input type="text" name="wg_event_id" value="'.Tools::safeOutput(Tools::getValue('wg_event_id', Configuration::get('WG_EVENT_ID'))).'" />      
  237.                 </div>
  238.                 <label>WebGain Pin</label>
  239.                 <div class="margin-form">
  240.                     <input type="text" name="wg_pin" value="'.Tools::safeOutput(Tools::getValue('wg_pin', Configuration::get('WG_PIN'))).'" />     
  241.                 </div>
  242.                 <label>WebGain Program Id</label>
  243.                 <div class="margin-form">
  244.                     <input type="text" name="wg_pgm_id" value="'.Tools::safeOutput(Tools::getValue('wg_pgm_id', Configuration::get('WG_PGM_ID'))).'" />    
  245.                 </div>
  246.                 <center><input type="submit" name="submitWG" value="Update" class="button" /></center>
  247.             </fieldset>
  248.         </form>';
  249.        
  250.         $output .= '
  251.         <p>&nbsp;</p>
  252.         <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
  253.             <fieldset class="width2">
  254.                 <legend><img src="../img/admin/cog.gif" alt="" class="middle" />Remove Order</legend>
  255.                 <label>Order</label>
  256.                 <div class="margin-form">
  257.                     <input type="text" name="order_id" value="" />
  258.                     <p class="clear">'.$this->l('Example:').' 99840971</p>
  259.                 </div>
  260.                 <center><input type="submit" name="removeOrder" value="Remove Order" class="button" /></center>
  261.             </fieldset>
  262.         </form>';
  263.        
  264.        
  265.  
  266.         $output .= '
  267.         <fieldset class="space">
  268.             <legend><img src="../img/admin/unknown.gif" alt="" class="middle" />'.$this->l('Help').'</legend>
  269.              <h3>'.$this->l('The first step for tracking e-commerce transactions is to enable e-commerce reporting for your website\'s profile.').'</h3>
  270.              '.$this->l('To enable e-Commerce reporting, please follow these steps:').'
  271.              <ol>
  272.                 <li>'.$this->l('Log in to your account').'</li>
  273.                 <li>'.$this->l('Click Edit next to the profile you would like to enable.').'</li>
  274.                 <li>'.$this->l('On the Profile Settings page, click Edit (next to Main Website Profile Information).').'</li>
  275.                 <li>'.$this->l('Change the e-Commerce Website radio button from No to Yes').'</li>
  276.             </ol>
  277.             <h3>'.$this->l('To set up your goals, enter Goal Information:').'</h3>
  278.             <ol>
  279.                 <li>'.$this->l('Return to Your Account main page').'</li>
  280.                 <li>'.$this->l('Find the profile for which you will be creating goals, then click Edit').'</li>
  281.                 <li>'.$this->l('Select one of the 4 goal slots available for that profile, then click Edit').'</li>
  282.                 <li>'.$this->l('Enter the Goal URL. Reaching this page marks a successful conversion.').'</li>
  283.                 <li>'.$this->l('Enter the Goal name as it should appear in your Google Analytics account.').'</li>
  284.                 <li>'.$this->l('Turn on Goal.').'</li>
  285.             </ol>
  286.             <h3>'.$this->l('Then, define a funnel by following these steps:').'</h3>
  287.             <ol>
  288.                 <li>'.$this->l('Enter the URL of the first page of your conversion funnel. This page should be a common page to all users working their way towards your Goal.').'</li>
  289.                 <li>'.$this->l('Enter a Name for this step.').'</li>
  290.                 <li>'.$this->l('If this step is a required step in the conversion process, mark the checkbox to the right of the step.').'</li>
  291.                 <li>'.$this->l('Continue entering goal steps until your funnel has been completely defined. You may enter up to 10 steps, or only one step.').'</li>
  292.             </ol>
  293.             '.$this->l('Finally, configure Additional settings by following the steps below:').'
  294.             <ol>
  295.                 <li>'.$this->l('If the URLs entered above are case sensitive, mark the checkbox.').'</li>
  296.                 <li>'.$this->l('Select the appropriate goal Match Type. (').'<a href="http://www.google.com/support/analytics/bin/answer.py?answer=72285">'.$this->l('Learn more').'</a> '.$this->l('about Match Types and how to choose the appropriate goal Match Type for your goal.)').'</li>
  297.                 <li>'.$this->l('Enter a Goal value. This is the value used in Google Analytics\' ROI calculations.').'</li>
  298.                 <li>'.$this->l('Click Save Changes to create this Goal and funnel, or Cancel to exit without saving.').'</li>
  299.             </ol>
  300.             <h3>'.$this->l('Demonstration: The order process').'</h3>
  301.             <ol>
  302.                 <li>'.$this->l('After having enabled your e-commerce reports and selected the respective profile enter \'order-confirmation.php\' as the targeted page URL.').'</li>
  303.                 <li>'.$this->l('Name this goal (for example \'Order process\')').'</li>
  304.                 <li>'.$this->l('Activate the goal').'</li>
  305.                 <li>'.$this->l('Add \'product.php\' as the first page of your conversion funnel').'</li>
  306.                 <li>'.$this->l('Give it a name (for example, \'Product page\')').'</li>
  307.                 <li>'.$this->l('Do not mark the \'required\' checkbox because the customer could be visiting directly from an \'adding to cart\' button such as in the homefeatured block on the homepage.').'</li>
  308.                 <li>'.$this->l('Continue by entering the following URLs as goal steps:').'
  309.                     <ul>
  310.                         <li>order/step0.html '.$this->l('(required)').'</li>
  311.                         <li>authentication.php '.$this->l('(required)').'</li>
  312.                         <li>order/step1.html '.$this->l('(required)').'</li>
  313.                         <li>order/step2.html '.$this->l('(required)').'</li>
  314.                         <li>order/step3.html '.$this->l('(required)').'</li>
  315.                     </ul>
  316.                 </li>
  317.                 <li>'.$this->l('Check the \'Case sensitive\' option').'</li>
  318.                 <li>'.$this->l('Save this new goal').'</li>
  319.             </ol>
  320.         </fieldset>';
  321.  
  322.         return $output;
  323.     }
  324.  
  325.     function hookHeader($params)
  326.     {
  327.         // Better way to check which file / controller name is loaded
  328.         if (!($file = basename(Tools::getValue('controller'))))
  329.             $file = str_replace(array('.php', '-'), '', basename($_SERVER['SCRIPT_NAME']));
  330.  
  331.         // Otherwise, create Google Analytics stats
  332.         $ganalytics_id = Configuration::get('GANALYTICS_ID');
  333.         $multilang = method_exists('Language', 'isMultiLanguageActivated') ? Language::isMultiLanguageActivated() : (Language::countActiveLanguages() > 1);
  334.         $defaultMetaOrder = Meta::getMetaByPage('order',$this->context->language->id);
  335.         $order = ($multilang?((string)Tools::getValue('isolang').'/'):'').$defaultMetaOrder['url_rewrite'];
  336.  
  337.         $pageTrack = preg_match('#(^'.__PS_BASE_URI__.'order.php)|(^'.__PS_BASE_URI__.($multilang ? ((string)Tools::getValue('isolang').'/') : '').$defaultMetaOrder['url_rewrite'].'[^-])#', $_SERVER['REQUEST_URI']) ?
  338.             '/order/step'.(int)Tools::getValue('step').'.html' : $file;
  339.  
  340.         $this->context->smarty->assign('ganalytics_id', $ganalytics_id);
  341.         $this->context->smarty->assign('pageTrack', $pageTrack);
  342.         $this->context->smarty->assign('isOrder', false);
  343.         return $this->display(__FILE__, 'header.tpl');
  344.     }
  345.  
  346.     function hookFooter($params)
  347.     {
  348.         // for retrocompatibility
  349.         if (!$this->isRegisteredInHook('header'))
  350.             $this->registerHook('header');
  351.         return ;
  352.     }
  353.     // MODIF QDUBOIS
  354.     function hookConfirmationPage($params) { return $this->hookOrderConfirmation($params); }
  355.     // END OF MODIF QDUBOIS
  356.     function hookOrderConfirmation($params)
  357.     {
  358.         // Setting parameters
  359.         $parameters = Configuration::getMultiple(array('PS_LANG_DEFAULT'));
  360.  
  361.         //$order = $params['objOrder'];  
  362.         // MODIF QDUBOIS
  363.         $id_order = $_GET['id_order'];
  364.         $order = new Order((int)$id_order);
  365.         // END OF MODIF QDUBOIS
  366.        
  367.         if (Validate::isLoadedObject($order))
  368.         {
  369.             $deliveryAddress = new Address(intval($order->id_address_delivery));
  370.  
  371.             $conversion_rate = 1;
  372.             if ($order->id_currency != Configuration::get('PS_CURRENCY_DEFAULT'))
  373.             {
  374.                 $currency = new Currency(intval($order->id_currency));
  375.                 $conversion_rate = floatval($currency->conversion_rate);
  376.             }
  377.  
  378.             // Order general information
  379.             $trans = array(
  380.                         'id' => intval($order->id),             // order ID - required
  381.                         //'store' => htmlentities(Configuration::get('PS_SHOP_NAME')), // affiliation or store name
  382.                         'store' => preg_replace('/[\'\x00-\x1F\x80-\xFF]/',' ', Configuration::get('PS_SHOP_NAME')),
  383.                         'total' => Tools::ps_round(floatval($order->total_paid) / floatval($conversion_rate), 2),       // total - required
  384.                         'tax' => '0', // tax
  385.                         'shipping' => Tools::ps_round(floatval($order->total_shipping) / floatval($conversion_rate), 2),    // shipping
  386.                         'city' => addslashes($deliveryAddress->city),       // city
  387.                         'state' => '',              // state or province
  388.                         'country' => addslashes($deliveryAddress->country) // country
  389.                         );
  390.  
  391.             // Product information
  392.             $products = $order->getProducts();
  393.             foreach ($products AS $product)
  394.             {
  395.                 $category = Db::getInstance()->getRow('
  396.                                 SELECT name FROM `'._DB_PREFIX_.'category_lang` , '._DB_PREFIX_.'product
  397.                                 WHERE `id_product` = '.intval($product['product_id']).' AND `id_category_default` = `id_category`
  398.                                 AND `id_lang` = '.intval($parameters['PS_LANG_DEFAULT']));
  399.  
  400.                 $items[] = array(
  401.                     'OrderId' => intval($order->id),                                // order ID - required
  402.                                 'SKU' => addslashes($product['product_id']),        // SKU/code - required
  403.                                 'Product' => addslashes($product['product_name']),      // product name
  404.                                 'Category' => addslashes($category['name']),            // category or variation
  405.                                 'Price' => Tools::ps_round(floatval($product['product_price_wt']) / floatval($conversion_rate), 2), // unit price - required
  406.                                 'Quantity' => addslashes(intval($product['product_quantity']))  //quantity - required
  407.                                 );
  408.             }
  409.             $ganalytics_id = Configuration::get('GANALYTICS_ID');
  410.            
  411.             $wgevid = Configuration::get('WG_EVENT_ID');
  412.             $wgpgmid = Configuration::get('WG_PGM_ID');
  413.             $wgpin = Configuration::get('WG_PIN');
  414.            
  415.             $doWebGain = false;
  416.             //WEBGAIN
  417.             if ($wgevid) {
  418.                 $wgOrderValue = $trans['total'];# total order value in the currency your program runs in (please do not include currency symbol)
  419.                 $wgOrderReference = rawurlencode($order->id);
  420.                 $wgVoucherCode = rawurlencode(''); #string, used to store the voucher code used for transaction
  421.                 $wgCurrency = 'EUR'; #only the following are valid: AUD,CAD,CHF,CZK,DKK,EUR,GBP,HKD,HUF,JPY,NOK,NZD,PLN,SEK,SGD,SKK,USD
  422.                 $wgEventID=$wgevid; # this identify's the commission type (in account under Program Setup (commission types))
  423.                 $wgComment= ''; #optional field
  424.                 $wgMultiple=1;
  425.                 $wgItems= rawurlencode('');
  426.                 /*    (optional) should contain pipe separated list of shopping basket items. Fields for each item are seperated by double colon.
  427.                                          First field is commission type ,  
  428.                                          second field is price of item,
  429.                                          third field (optional) is name of item, f
  430.                                          ourth field (optional) is product code/id, f
  431.                                          ifth field (optional) is voucher code.
  432.                                          Example for two items; items=1::54.99::Harry%20Potter%20dvd::hpdvd93876|5::2.99::toothbrush::tb287::voucher1    */
  433.                 $wgCustomerID= '';# please do not use without contacting us first
  434.                 $wgProductID= '';# please do not use without contacting us first
  435.                
  436.                
  437.                 /*    </variables to be assigned values at run time>    */
  438.                
  439.                 /*    <variables to be assigned values on install>    */
  440.                 $wgSLang = 'php';# string, used to identify the programming language of your online systems. Needed because url_encoding differs between platforms.
  441.                 $wgLang = 'fr_FR';# string, used to identify the human language of the transaction
  442.                 $wgPin = $wgpin;# pin number provided by webgains (in account under Program Setup (program settings -> technical setup))
  443.                 $wgProgramID = $wgpgmid; # int, used to identify you to webgains systems
  444.                 /*    </variables to be assigned values on install>    */
  445.                
  446.                 /*    <not user configurable>    */
  447.                 $wgVersion = '1.2';
  448.                 $wgSubDomain="track";
  449.                 $wgCheckString ="wgver=$wgVersion&wgsubdomain=$wgSubDomain&wglang=$wgLang&wgslang=$wgSLang&wgprogramid=$wgProgramID&wgeventid=$wgEventID&wgvalue=$wgOrderValue&wgorderreference=$wgOrderReference&wgcomment=$wgComment&wgmultiple=$wgMultiple&wgitems=$wgItems&wgcustomerid=$wgCustomerID&wgproductid=$wgProductID&wgvouchercode=$wgVoucherCode";
  450.                 $wgCheckSum=md5($wgPin.$wgCheckString); # make checksum
  451.                 $wgQueryString = $wgCheckString."&wgchecksum=".$wgCheckSum."&wgCurrency=".$wgCurrency;
  452.                 $wgUri = '://'.$wgSubDomain.".webgains.com/transaction.html?".$wgQueryString;
  453.                 $doWebGain = true;
  454.             }
  455.             //ENDOF WEBGAIN
  456.  
  457.             $this->context->smarty->assign('items', $items);
  458.             $this->context->smarty->assign('trans', $trans);
  459.             $this->context->smarty->assign('ganalytics_id', $ganalytics_id);
  460.             $this->context->smarty->assign('wgQueryString', $wgQueryString);
  461.             $this->context->smarty->assign('wgUri', $wgUri);
  462.             $this->context->smarty->assign('wgSubDomain', $wgSubDomain);
  463.             $this->context->smarty->assign('doWebGain', $doWebGain);
  464.             $this->context->smarty->assign('isOrder', true);
  465.             return $this->display(__FILE__, 'header.tpl');
  466.         }
  467.     }
  468. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement