PDA

View Full Version : osCommerce Google Analytics module



michael_s
01-23-2009, 06:10 AM
If your store uses VAT, you will have to change the $items_query and $item_string like so (based on tomashesseling's version from 15 Jan 2008):

$items_query = tep_db_query("select products_id, products_model, products_name, final_price, products_tax, products_quantity from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . $order_id . "' order by products_name");
while ($items = tep_db_fetch_array($items_query)) {
$category_query = tep_db_query("select p2c.categories_id, cd.categories_name from " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p2c.products_id = '" . $items['products_id'] . "' AND cd.categories_id = p2c.categories_id AND cd.language_id = '" . (int)$languages_id . "'");
$category = tep_db_fetch_array($category_query);

$item_string .= "pageTracker._addItem(n"" . $order_id . "","" . $items['products_id'] . "","" . $items['products_name'] . "","" . $category['categories_name'] . "","" . number_format(tep_add_tax($items['final_price'], $items['products_tax']), 2) . "","" . $items['products_quantity'] . "");n";
}

More... (http://addons.oscommerce.com/info/3756)