Snippet Shortcodes
  • Welcome
  • Getting Started
    • Page
    • Quickstart
    • What is the Premium Plugin?
    • Creating your first shortcode
  • Features
    • Overview
      • Auto-insert into Header / Footer
      • Limit to Device Types
    • Your own Shortcodes
    • Ready-made Shortcodes
      • Premium
        • Database values by ID
        • WooCommerce Meta Fields
        • WordPress User fields
      • Core
    • CSV Import
  • Further Info
    • Pricing & getting a license
  • Release notes
  • Contact / Issues
  • Download Links
    • Core plugin
  • Premium Plugin
Powered by GitBook
On this page
Edit on GitHub
  1. Features
  2. Ready-made Shortcodes
  3. Premium

WooCommerce Meta Fields

This shortcode allows you to fetch and display a WooCommerce user profile field for the currently logged-in user.

Easy-to-use examples:

Below are a few examples to get you started. Additional field names can be found using the reference provided below.

[sv slug="woocommerce" field="billing_first_name"]
[sv slug="woocommerce" field="billing_last_name"]
[sv slug="woocommerce" field="billing_company"]
[sv slug="woocommerce" field="billing_address_1"]
[sv slug="woocommerce" field="billing_address_2"]
[sv slug="woocommerce" field="billing_city"]
[sv slug="woocommerce" field="billing_postcode"]
[sv slug="woocommerce" field="billing_country"]
[sv slug="woocommerce" field="billing_state"]
[sv slug="woocommerce" field="billing_email"]
[sv slug="woocommerce" field="billing_phone"]
[sv slug="woocommerce" field="shipping_first_name"]
[sv slug="woocommerce" field="shipping_last_name"]
[sv slug="woocommerce" field="shipping_company"]
[sv slug="woocommerce" field="shipping_address_1"]
[sv slug="woocommerce" field="shipping_address_2"]
[sv slug="woocommerce" field="shipping_city"]
[sv slug="woocommerce" field="shipping_postcode"]
[sv slug="woocommerce" field="shipping_country"]
[sv slug="woocommerce" field="shipping_state"]

Shortcode Arguments

The shortcode supports the following arguments:

Argument
Description
Options
Example

field

WooCommerce field to display e.g. billing_address

text

[sv slug="woocommerce" field="billing_phone"]

message-not-found

Message to display if field is empty

Text

[sv slug="woocommerce" field="billing_phone" message-not-found="Phone number is missing"]

PreviousDatabase values by IDNextWordPress User fields

Last updated 5 days ago