Linux 软件免费装
Banner图

Show Orders Shortcode for WooCommerce

开发者 conschneider
更新时间 2026年7月16日 22:46
PHP版本: 7.4 及以上
WordPress版本: 7.0
版权: GPLv3
版权网址: 版权信息

标签

shortcode woocommerce orders my account order history

下载

1.1.0 1.2.0

详情介绍:

Drop [show_wc_orders] into any page, post or widget area that renders shortcodes, and the logged-in customer sees their own orders: order number, date, status, total and a View button — the same table WooCommerce shows under My Account > Orders. Usage: [show_wc_orders] shows all of the customer's orders. [show_wc_orders order_count=10] shows the 10 most recent orders — replace 10 with any number. That is all. There are no settings. Details:

安装:

  1. Upload the plugin files to the /wp-content/plugins/wc-show-orders-shortcode directory, or install the plugin through the WordPress plugins screen directly.
  2. Activate the plugin through the 'Plugins' menu in WordPress.
  3. Add [show_wc_orders] to any page or post.

屏幕截图:

  • Limiting the output with order_count.
  • The shortcode in the block editor.

升级注意事项:

1.2.0 Orders display again on modern (HPOS) stores and the table now matches My Account. Shortcode and attributes unchanged, still no settings.

常见问题:

Which orders are shown?

The orders of the currently logged-in customer, newest first. Logged-out visitors see nothing — there is no way to view another customer's orders through this shortcode.

The table was empty on my store — is that fixed?

Yes. Version 1.1.0 read orders from the legacy post storage, so on stores using High-Performance Order Storage (the WooCommerce default since 8.2) it rendered nothing. 1.2.0 queries orders through the storage-agnostic WooCommerce API and works on both storage modes.

Can I change the columns or styling?

The shortcode renders WooCommerce's own myaccount/orders.php template. Anything that customises the My Account orders table — a theme override of that template, or the woocommerce_account_orders_columns filter — applies here as well.

Is there pagination?

No. The shortcode shows the order_count most recent orders (all orders by default). For a paginated order history, point customers at My Account > Orders.

Can I show a login prompt to logged-out visitors instead of nothing?

Not yet — the shortcode intentionally outputs nothing for guests. If you need this, ask in the support forum.

更新日志:

1.2.0 1.1.0 Added control statement to check for logged in status. 1.0.0 Initial release.