简体   繁体   English

在感谢页面 WooCommerce 上获取 cookie 值

[英]Getting cookie value on thankyou page WooCommerce

Using woocommerce_thankyou hook to send and receive data from api during order submission.在订单提交期间使用 woocommerce_thankyou 钩子从 api 发送和接收数据。 In one of my requests, i get an order number from in-house software.. example: 321000在我的一个请求中,我从内部软件中获得了一个订单号。例如:321000

$_SESSION['quotes'] = $quoteId;
echo session_id() . '</br>';
echo $_SESSION['quotes'] . '</br>';

which outputs:输出:

0ajcojut4fu9cac4ji96gj9j03
321000

I need to get this number on the thank you page.我需要在感谢页面上得到这个号码。 I have tried both sessions and cookies.我已经尝试了会话和 cookie。 I am able to save this value both ways, but it outputs previous variable on thank you page.我能够以两种方式保存此值,但它会在感谢页面上输出先前的变量。

When I echo on thankyou page, previous value is used.. example 320999当我在谢谢页面上回声时,使用以前的值.. 示例 320999

Is there a way to set and echo session variable/cookie before thank you page is shown?有没有办法在显示感谢页面之前设置和回显会话变量/cookie?

Is there another hook I should be using instead of woocommerce_thankyou我应该使用另一个钩子而不是 woocommerce_thankyou

我使用了 woocommerce_checkout_order_processed 钩子而不是 woocommerce_thankyou 并且一切正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Woocommerce在Thankyou页面上加载外部页面 - Woocommerce load an external page on thankyou page 选择 BACS 帐户以显示在 WooCommerce 的感谢页面中 - Select BACS account to show in thankyou page in WooCommerce 在 Woocommerce 感谢页面上添加产品缩略图 - Add the product thumbnail on Woocommerce Thankyou page Woocommerce 感谢页面中的 Linkwise Affiliate 集成 - Linkwise Affiliate integration in Woocommerce thankyou page 在Woocommerce谢谢页面中获取数组中的产品名称 - Get products names in an array in Woocommerce thankyou page 我如何删除<br>在帐单地址和显示地址和城市文本之前的值(woocommerce 谢谢页面)? - How do I remove the <br> in billing address and display address and city text before the value ( woocommerce thankyou page )? 如何在woocommerce感谢页面上添加或显示产品价格? - How do I add or display the product price in woocommerce thankyou page? WooCommerce - 在thankyou页面上选择本地取件时隐藏送货地址 - WooCommerce - Hide shipping address when local pickup is chosen on thankyou page 即使未注册,在WooCommerce Thankyou页面上显示客户详细信息 - Show customer details on WooCommerce Thankyou page even if not registered WooCommerce-在“谢谢”订单接收页面上自定义“总计”文本 - WooCommerce - Customize “Total” text on Thankyou order received page
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM