Results 1 to 10 of 23

Hybrid View

  1. #1
    Join Date
    Oct 2006
    Location
    Italy
    Posts
    634
    Plugin Contributions
    0

    Default Re: script for thank you page

    Thank you so much for your help!
    I wait for the mechant-key from Trovaprezzi search engine, and then let you know if your script works well.

  2. #2
    Join Date
    Oct 2006
    Location
    Italy
    Posts
    634
    Plugin Contributions
    0

    Default Re: script for thank you page

    PHP Code:
    <?php
    //-Add the tracking script only for the checkout_success page
    $customer_email_info $db->Execute ("SELECT customers_email_address FROM " TABLE_CUSTOMERS " WHERE customers_id = " . (int)$_SESSION['customers_id'] . " LIMIT 1");
    if (!
    $customer_email_info->EOF) {
      
    $customers_email_address $customer_email_info->fields['customers_email_address'];
    ?>
      <script type="text/javascript" src="https://tracking.trovaprezzi.it/javascripts/tracking.min.js" async="true"></script>

      <script type="text/javascript">
          window._tt = window._tt || [];
          window._tt.push({ event: "setAccount", id: "RMUnJ1SUw1" });
          window._tt.push({ event: "setOrderId", order_id: "<?php echo $order_id?>" });
          window._tt.push({ event: "setEmail", email: "<?php echo $customers_email_address?>"  });
    <?php
      
    foreach ($orders->products as $current_product) {
    ?>
          window._tt.push({ event: "addItem", sku: "<?php echo $current_product['model']; ?>" , product_name: "<?php echo $current_product['name']; ?>" });
    <?php
      
    }
    ?>
          window._tt.push({ event: "orderSubmit"});
      </script>
    <?php
    }
    but nothing happens

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,873
    Plugin Contributions
    96

    Default Re: script for thank you page

    So, you created the separate file (/includes/modules/pages/checkout_success/jscript_tracking.php) with the contents above. Now, on the checkout_success page, when "nothing happens" ... what does that mean?

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,873
    Plugin Contributions
    96

    Default Re: script for thank you page

    OK, after re-reviewing the header processing for the checkout_success page, I was using the wrong variables, having incorrectly assumed that an order-class element had been created. Give the following a go:
    Code:
    <?php
    //-Add the tracking script only for the checkout_success page
    $customer_email_info = $db->Execute ("SELECT customers_email_address FROM " . TABLE_CUSTOMERS . " WHERE customers_id = " . (int)$_SESSION['customers_id'] . " LIMIT 1");
    if (!$customer_email_info->EOF) {
      $customers_email_address = $customer_email_info->fields['customers_email_address'];
    ?>
      <script type="text/javascript" src="https://tracking.trovaprezzi.it/javascripts/tracking.min.js" async="true"></script>
    
      <script type="text/javascript">
          window._tt = window._tt || [];
          window._tt.push({ event: "setAccount", id: /* keymerchant */ });
          window._tt.push({ event: "setOrderId", order_id: <?php echo $order_id; ?> /* idorder */ });
          window._tt.push({ event: "setEmail", email: "<?php echo $customers_email_address; ?>" /* emailcucstomer */ });
    <?php
      $products_info = $db->Execute ("SELECT products_model, products_name FROM " . TABLE_ORDERS_PRODUCTS . " WHERE orders_id = $order_id");
      while (!$products_info->EOF) {
    ?>
          window._tt.push({ event: "addItem", sku: "<?php echo $products_info->fields['products_model']; ?>" /* sku */, product_name: "<?php echo $products_info->fields['products_name']; ?>" /* product_name */ });
    <?php
        $products_info->MoveNext ();
      }
    ?>
          window._tt.push({ event: "orderSubmit"});
      </script>
    <?php
    }

  5. #5
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: script for thank you page

    Part of why lat9 has asked that question s that the script provided basically gathers data together and provides it back to the "company" to provide additional tracking information. There are results that should be able to be reviewed, but the "nothing happens" description does not clearly identify 1) action taken to validate operation or 2) results of that action.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  6. #6
    Join Date
    Oct 2006
    Location
    Italy
    Posts
    634
    Plugin Contributions
    0

    Default Re: script for thank you page

    the example script equipped by Trovaprezzi need to track shop by customer and invites to add reviews on trovaprezzi website
    Here you can find a guide to installation: https://tracking.trovaprezzi.it/guida.html
    So, the script edited by lat9 don't start, so if I open the ceckout_success source page, there is no trace of the code.
    Last edited by 100asa; 12 Feb 2016 at 06:37 PM.

  7. #7
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,873
    Plugin Contributions
    96

    Default Re: script for thank you page

    Does your store's template already load a version of jQuery >= 1.4?

  8. #8
    Join Date
    Oct 2006
    Location
    Italy
    Posts
    634
    Plugin Contributions
    0

    Default Re: script for thank you page

    yes, sure!

 

 

Similar Threads

  1. Replies: 10
    Last Post: 26 Mar 2016, 02:53 AM
  2. Admin Page - "Hello. Thank you for loading Zen Cart" - OH help!
    By iwalkonstars in forum Basic Configuration
    Replies: 9
    Last Post: 1 Jun 2014, 07:53 PM
  3. How do you add text to last Thank You page after purchase complete?
    By catangirl in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 24 Sep 2007, 10:25 PM
  4. Thank you page
    By DanAllkins in forum Built-in Shipping and Payment Modules
    Replies: 4
    Last Post: 15 Sep 2007, 10:40 PM
  5. Where is HTML for order confirmation/thank you page?
    By chacha-vintage in forum General Questions
    Replies: 0
    Last Post: 22 Aug 2007, 10:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg