wordpress 数据库中放置的 woocommerce 订单在哪里 [英] where is a woocommerce order placed in wordpress database

查看:30
本文介绍了wordpress 数据库中放置的 woocommerce 订单在哪里的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常简单的问题.但它困扰我很多.

I have a very simple question. but its bothering me a lot.

任何人都可以告诉我从 WordPress woo-commerce 网站放置订单后,订单和其中的所有内容都存储在数据库中的位置.更准确地说,谁能告诉我如何在不使用 WC_Order 类等 woocommerce 类的情况下获取我的送货地址?我的意思是我需要通过我的自定义数据库查询手动获取这些数据,但我无法在我的数据库中找到订单以及与之相关的所有内容?我知道订单作为 wp-posts 表中的帖子存储在数据库中,但其余部分在哪里,即送货地址账单地址等?我希望我不会混淆任何人.

Can any one please tell me where does an order and every thing in it is stored in the database after it is placed from a WordPress woo-commerce website. To be more precise can anyone tell me how can I get my shipping address without using woocommerce classes like WC_Order class? I mean I need to get that data manually through my custom database queries, but I cant find the order and everything associated with it in my database? I know order is stored in the database as post in the wp-posts table but where is the rest of it i.e shipping address billing address etc etc? I hope I am not confusing anyone.

此致,

马克

推荐答案

订单是自定义帖子类型 (CPT),因此它们存储在 wp_posts 表中.如果您在 post_type 字段中搜索shop_order",SQL 将检索所有订单.

Orders are a Custom Post Type (CPT), so they are stored in the wp_posts table. If you search the post_type field for 'shop_order', SQL will retrieve all orders.

然后,您必须在 wp_postmeta 表中搜索 post_id 与订单帖子的 id 匹配的所有记录.然后,您将在 wp_postmeta 表中找到的字段中包含完整的送货地址和帐单地址.

Then, you must search the wp_postmeta table for all the records with post_id matching the id of the order post. Among the fields you will then find in the wp_postmeta table will be the entire shipping and billing addresses.

这篇关于wordpress 数据库中放置的 woocommerce 订单在哪里的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆