tpl_checkout_success_default 中的 orderTotal 和 orderId - zen-cart
有什么想法如何在 tpl_checkout_success_default 中获取 orderTotal 和 orderId 以进行转化跟踪吗?
到目前为止,看起来订单 id 可以通过使用此变量 $zv_orders_id 来访问,但是如何获取订单总数?
此代码是否有效:
$orders_query = "SELECT * FROM zen_orders WHERE orders_id = " 。 $zv_orders_id ." 限制 1"; $orders = $db->执行($orders_query); $order_total = $orders->fields['order_total'];
非常感谢, 干杯
any ideas how to get orderTotal and orderId inside the tpl_checkout_success_default for the conversions tracking purposes ?
So far it looks like order id can be accessed by using this variable $zv_orders_id but how to get order total ?
will this code work:
$orders_query = "SELECT * FROM zen_orders WHERE orders_id = " . $zv_orders_id ." LIMIT 1";
$orders = $db->Execute($orders_query);
$order_total = $orders->fields['order_total'];
many thanks,
cheers
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看
/includes/modules/pages/checkout_success/header_php.php
,您将看到
zencart
已经在运行查询来处理您的订单,并且 id 表示其已经拉出了你想要的信息。因此,您只需将所需的数据设置为一个变量,然后就可以在
tpl_checkout_success_default.php
文件中使用该变量。例如,类似
$customer_has_gv_balance
的内容,您将看到它在听者文件中的设置位置,然后在模板文件中使用,这是我在
order.php
中找到的内容,这几乎将按原样做:look in
/includes/modules/pages/checkout_success/header_php.php
in there you will see the queries already being run by
zencart
to do with your order, and id say its already pulling out the info you want.so you just need to set said data you need to a variable that you can then use in your
tpl_checkout_success_default.php
file.eg, something like
$customer_has_gv_balance
, you will see where it is set in the hearder file and then used in the template fileheres something i found in
order.php
that would almost do it as is:对于简单的跟踪代码(例如用于购物比较网站的跟踪代码),我使用以下内容作为订单 ID 和订单金额。在 tpl_checkout_success.php 页面中使用这些
订单 ID:
使用此选择语句:
订单金额:
希望这对某人有帮助!
For a simple tracking code like one used for a shopping comparison site, I've used the following for the order ID and order amount. Use these in the tpl_checkout_success.php page
Order ID:
Use this select statement:
Order amount:
Hope this helps someone!