$emos->addOrderProcess("5_Bestaetigung"); break; case FILENAME_CHECKOUT_SUCCESS: $emos->addOrderProcess("6_Erfolg"); // billing daten $last_orders_query = xtc_db_query("select orders_id, customers_city, customers_postcode, customers_country from " . TABLE_ORDERS . " where customers_id = '" . (int) $_SESSION['customer_id'] . "' order by date_purchased desc limit 1"); $last_orders = xtc_db_fetch_array($last_orders_query); // basket daten $last_orders_products_query = xtc_db_query("select products_id, products_quantity, products_price, products_tax from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int) $last_orders['orders_id'] . "' order by orders_products_id"); $count = 0; $basket = array(); $last_orders_totalprice = 0; while ($last_orders_products = xtc_db_fetch_array($last_orders_products_query)) { if (ECONDA_PRICE_IS_BRUTTO == 'false') { $last_orders_totalprice += $last_orders_products['products_price'] * $last_orders_products['products_quantity'] / (1 + $last_orders_products['products_tax'] / 100); } else { $last_orders_totalprice += $last_orders_products['products_price'] * $last_orders_products['products_quantity']; } $item = product_to_EMOSItem($last_orders_products['products_id'], $_SESSION['languages_id'], $last_orders_products['products_quantity']); $basket[$count] = $item; $count++; } $emos->addEmosBillingPageArray($last_orders['orders_id'], $_SESSION['customer_id'], sprintf("%0.2f", $last_orders_totalprice), $last_orders['customers_country'], $last_orders['customers_postcode'], $last_orders['customers_city']); $emos->addEmosBasketPageArray($basket); break; default: break; } // output echo $emos->toString(); echo "\n<!-- Econda-Monitor -->\n";
/** * Test to string. * * @return null */ public function testToString() { $oEmos = new EMOS("xxx", "yyy"); //$oEmos->appendPreScript( 'pre' ); //$oEmos->appendPostScript( 'post' ); //$oEmos->jsFormatPrescript = "__JSPreScript__"; //$oEmos->jsFormatScript = "__JSScript__"; //$sExpt = "pre<script type=\"text/javascript\">window.emosTrackVersion = 2;</script>\n<script type=\"text/javascript\" src=\"xxxyyy\"></script>\n<script type=\"text/javascript\"><!--\n\tvar emospro = {};\n\twindow.emosPropertiesEvent(emospro);\n//-->\n</script>\npost"; $sExpt = "<script type=\"text/javascript\">window.emosTrackVersion = 2;</script>\n<script type=\"text/javascript\" src=\"xxxyyy\"></script>\n<script type=\"text/javascript\"><!--\n\tvar emospro = {};\n\twindow.emosPropertiesEvent(emospro);\n//-->\n</script>\n"; $oEmos->prettyPrint(); $this->assertEquals($sExpt, $oEmos->toString()); }