2014-08-27 59 views
-4

我尝试打开车成功页面设置像素,我有这样的代码:PHP会议回声0

$order_id=(int)$this->session->data['order_id']; 
$total_price=$this->cart->getTotal(); 

$output= "<img src=\"http://track.lead-r.ru/?method=reportAction&transaction_id=". $order_id . "&advertiser_id=2158&offer=2158VxTkF:". $total_price ."\" alt=\"\" style=\"width: 0; height: 0; position:absolute;\" />"; 

其返回

<img src="http://track.lead-r.ru/?method=reportAction&transaction_id=0&advertiser_id=2158&offer=2158VxTkF:0" alt="" style="width: 0; height: 0; position:absolute;" /><div id="footer"> 

如果我设置

$order_id=123; 
$total_price=123; 

所有工作不错

<img src="http://track.lead-r.ru/?method=reportAction&transaction_id=123&advertiser_id=2158&offer=2158VxTkF:123" alt="" style="width: 0; height: 0; position:absolute;" /><div id="footer"> 

看这个http://rghost.ru/57715199

+0

'$ this-> session-> data ['order_id'];'没有将它转换为int类型的值是什么? – 2014-08-27 18:56:09

+0

我尝试<? echo $ order_id $ total_price?>这也可以。然后他们“$ order_id =(int)$ this-> session-> data ['order_id'];”和“$ total_price = $ this-> cart-> getTotal();” 。我可以在页面上看到他们,但在查看源代码时为空

。 – 2014-08-27 18:59:53

+0

等我创造了光棍节 – 2014-08-27 19:02:28

回答

0

我从来没有使用过Opencart的,但我已经使用笨,似乎类似,会话返回0的原因是因为该会话实际上是返回假,因为你将它转换成int是显示0.如果有可能,然后检查,您已设置会话数据。