你知道如何在tpl_checkout_success_default中使用orderTotal和orderId来进行转换跟踪吗?
到目前为止,订单id看起来可以使用这个变量$zv_orders_id来访问,但是如何获得订单总数呢?
这段代码可以工作吗:
$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'];
非常感谢,干杯
发布于 2012-01-25 18:22:11
在/includes/modules/pages/checkout_success/header_php.php中查找
在那里,你会看到zencart已经在运行查询来处理你的订单,我说它已经提取了你想要的信息。
因此,您只需将所需的数据设置为一个变量,然后就可以在tpl_checkout_success_default.php文件中使用该变量。
例如,类似于$customer_has_gv_balance的内容,您将看到它在hearder文件中设置的位置,然后在模板文件中使用
下面是我在order.php中发现的一些东西,它们几乎可以按原样完成:
$order_total_query = "select text, value
from " . TABLE_ORDERS_TOTAL . "
where orders_id = '" . (int)$order_id . "'
and class = 'ot_total'";
$order_total = $db->Execute($order_total_query);发布于 2012-01-28 12:13:01
对于一个简单的跟踪代码,比如用于购物比较站点的代码,我使用以下代码作为订单ID和订单金额。在tpl_checkout_success.php页面中使用这些
订单ID:
echo $zv_orders_id;使用以下select语句:
$to_send_sql = 'select REPLACE (text,"$","") text from orders_total where orders_id = '.$zv_orders_id.' and class = "ot_subtotal"';
$to_send= $db->Execute($to_send_sql);订单金额:
echo $to_send->fields['text'];希望这对某些人有帮助!
https://stackoverflow.com/questions/9000627
复制相似问题