Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. <?php
  2. // components/com_virtuemart/themes/default/templates/pages/checkout.thankyou.tpl.php
  3. // after line 24
  4.  
  5. $order_id = $db->record[0]->order_id;
  6. $order_items = new ps_DB;
  7. $q = "SELECT * FROM `#__{vm}_order_item` WHERE `order_id`='$order_id'";
  8. $order_items->query($q);
  9.  
  10. $GLOBALS['GA_ECOMM_ITEMS'] = array();
  11. foreach ($order_items->record as $item) {
  12. $GLOBALS['GA_ECOMM_ITEMS'][] = array(
  13. 'sku' => $item->order_item_sku,
  14. 'name' => htmlspecialchars($item->order_item_name),
  15. 'category' => '',
  16. 'price' => $item->product_final_price,
  17. 'quantity' => $item->product_quantity,
  18. );
  19. }
  20.  
  21. $GLOBALS['GA_ECOMM_TRANS'] = array(
  22. 'id' => $order_id,
  23. 'affiliation' => '',
  24. 'revenue' => $db->record[0]->order_total,
  25. 'shipping' => $db->record[0]->order_shipping,
  26. 'tax' => $db->record[0]->order_tax
  27. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement