分析支付页面的代码,但没有用javascript代码编写代码..
例如(HTML 打印):
<script>
woopra.track('Odeme Sayfasi', {
urunSayisi: '',
amount: '',
currency: '$'
});
</script>
21234.55
2: 2个产品
1234.55:数量
PHP & Javascript 代码:
<?php
$mageFilename = '/home4/emre2010/public_html/app/Mage.php';
require_once $mageFilename;
umask(0);
Mage::app();
Mage::getSingleton('core/session', array('name'=>'frontend'));
$session = Mage::getSingleton('checkout/session');
$output = "";
foreach ($session->getQuote()->getAllItems() as $item) { ?>
<script>
woopra.track('Payment Page', {
urunSayisi: '<?php $output .= $item->getQty(); ?>',
amount: '<?php $output .= $item->getBaseCalculationPrice(); ?>',
currency: '$'
});
</script>
<?php } print $output; ?>
为什么不写入javascript代码?- 我哪里出错了?
PS:电商脚本:Magento 1