简体   繁体   English

如何为每个WooCommerce订单动态创建页面?

[英]How to create page dynamically for every WooCommerce order?

Guys I'm trying to create a page for every WooCommerce order specifically. 伙计们,我正在尝试为每个WooCommerce订单专门创建一个页面。 So user makes an order, I generate an ID for that order (the id will form the URL of the page)and whenever someone goes onto that url (mywebsite.com/generated_order_id) he can see info that is specific for the order. 因此,用户下订单时,我会为该订单生成一个ID(该ID将构成页面的URL),每当有人进入该URL(mywebsite.com/generated_order_id)时,他都可以看到特定于该订单的信息。

So this would be the user story -> I confirm the order -> I get the URL of the page(That page is created dynamically, at the moment when I finished my order). 所以这就是用户故事->我确认订单->我得到页面的URL(该页面是在我完成订单时动态创建的)。

I'm not asking for the solution, just for the concepts, tools and a way I should look up to get to the solution. 我并不是在寻求解决方案,而只是在寻求概念,工具和寻求解决方案的方式。 Thanks in advance. 提前致谢。

Do you need to set access permission for page? 您是否需要设置页面访问权限? Like only for that user. 只喜欢该用户。

Every time and order is generated, it's save to the database as a POST so you can get the id from there. 每次生成订单时,它都会以POST的形式保存到数据库中,因此您可以从那里获取ID。 Even that, WooCommerce generates an order page after the checkout process. 即便如此,WooCommerce在结帐过程之后也会生成一个订单页面。 The URL is something like: 该网址类似于:

yourblog.com/checkout/order-received/{POST_ID}/?key={WC_ORDER_KEY} yourblog.com/checkout/order-received/{POST_ID}/?key={WC_ORDER_KEY}

So You could use this page and edit the template from your theme. 因此,您可以使用此页面并从主题中编辑模板。

Hope it helps! 希望能帮助到你!

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM