WooCommerce Code Reference
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  • Hook Reference
  • WooCommerce Docs
  • REST API Docs

Packages

  • None
  • WooCommerce
    • Abstracts
    • Admin
      • Customize
      • Functions
      • Importers
      • Meta
      • Reports
      • System
    • API
    • Classes
      • Data
        • Store
      • Emails
      • Embed
      • Integrations
      • Interfaces
      • Log
        • Handlers
      • Payment
      • Products
      • Shipping
      • Walkers
    • Export
    • Functions
    • Import
    • l10n
    • PaymentTokens
    • PayPal
    • Shortcodes
      • Cart
      • Checkout
      • My
        • Account
      • Order
        • Tracking
    • Webhooks
    • Widgets
  • WP-Background-Processing

Classes

  • Abstract_WC_Order_Item_Type_Data_Store
  • Emogrifier
  • Simplify
  • Simplify_AccessToken
  • Simplify_Authentication
  • Simplify_Authorization
  • Simplify_CardToken
  • Simplify_Chargeback
  • Simplify_Constants
  • Simplify_Coupon
  • Simplify_Customer
  • Simplify_Deposit
  • Simplify_Event
  • Simplify_FieldError
  • Simplify_FraudCheck
  • Simplify_HTTP
  • Simplify_Invoice
  • Simplify_InvoiceItem
  • Simplify_Object
  • Simplify_Payment
  • Simplify_PaymentsApi
  • Simplify_Plan
  • Simplify_Refund
  • Simplify_ResourceList
  • Simplify_Subscription
  • Simplify_Tax
  • Simplify_TransactionReview
  • Simplify_Webhook
  • WC_Admin_Duplicate_Product
  • WC_API_Authentication
  • WC_API_Coupons
  • WC_API_Customers
  • WC_API_Exception
  • WC_API_Handler
  • WC_API_JSON_Handler
  • WC_API_Orders
  • WC_API_Products
  • WC_API_Reports
  • WC_API_Resource
  • WC_API_Server
  • WC_API_Webhooks
  • WC_Coupon_Data_Store_CPT
  • WC_Customer_Data_Store
  • WC_Customer_Data_Store_Session
  • WC_Customer_Download_Data_Store
  • WC_Customer_Download_Log_Data_Store
  • WC_Data_Store
  • WC_Data_Store_WP
  • WC_Eval_Math
  • WC_Eval_Math_Stack
  • WC_Gateway_Paypal_API_Handler
  • WC_Gateway_Paypal_PDT_Handler
  • WC_Gateway_Paypal_Refund
  • WC_Gateway_Paypal_Request
  • WC_Gateway_Paypal_Response
  • WC_Helper
  • WC_Helper_API
  • WC_Helper_Compat
  • WC_Helper_Options
  • WC_Helper_Plugin_Info
  • WC_Helper_Updater
  • WC_Order_Item_Coupon_Data_Store
  • WC_Order_Item_Data_Store
  • WC_Order_Item_Fee_Data_Store
  • WC_Order_Item_Product_Data_Store
  • WC_Order_Item_Shipping_Data_Store
  • WC_Order_Item_Tax_Data_Store
  • WC_Order_Refund_Data_Store_CPT
  • WC_Payment_Token_Data_Store
  • WC_Product_Grouped_Data_Store_CPT
  • WC_Product_Variation_Data_Store_CPT
  • WC_Shipping_Zone_Data_Store

Interfaces

  • WC_Abstract_Order_Data_Store_Interface
  • WC_Coupon_Data_Store_Interface
  • WC_Customer_Data_Store_Interface
  • WC_Customer_Download_Data_Store_Interface
  • WC_Customer_Download_Log_Data_Store_Interface
  • WC_Log_Handler_Interface
  • WC_Logger_Interface
  • WC_Object_Data_Store_Interface
  • WC_Order_Data_Store_Interface
  • WC_Order_Item_Data_Store_Interface
  • WC_Order_Item_Product_Data_Store_Interface
  • WC_Order_Item_Type_Data_Store_Interface
  • WC_Order_Refund_Data_Store_Interface
  • WC_Payment_Token_Data_Store_Interface
  • WC_Product_Data_Store_Interface
  • WC_Product_Variable_Data_Store_Interface
  • WC_Shipping_Zone_Data_Store_Interface

Exceptions

  • Simplify_ApiConnectionException
  • Simplify_ApiException
  • Simplify_AuthenticationException
  • Simplify_BadRequestException
  • Simplify_NotAllowedException
  • Simplify_ObjectNotFoundException
  • Simplify_SystemException

Functions

  • wc_coupons_enabled
  • wc_get_cart_coupon_types
  • wc_get_coupon_code_by_id
  • wc_get_coupon_id_by_code
  • wc_get_coupon_type
  • wc_get_coupon_types
  • wc_get_product_coupon_types
  • wc_importer_current_locale
  • wc_importer_default_english_mappings
  • wc_importer_default_special_english_mappings
  • wc_importer_generic_mappings
  • wc_importer_wordpress_mappings

Class WC_Customer_Data_Store

WC Customer Data Store.

WC_Data_Store_WP
Extended by WC_Customer_Data_Store implements WC_Customer_Data_Store_Interface, WC_Object_Data_Store_Interface
Category: Class
Author: WooThemes
Version: 3.0.0
Located at data-stores/class-wc-customer-data-store.php

Methods summary

protected boolean
# exclude_internal_meta_keys( object $meta )

Callback to remove unwanted meta data.

Callback to remove unwanted meta data.

Parameters

$meta

Returns

boolean

Overrides

WC_Data_Store_WP::exclude_internal_meta_keys
public
# create( WC_Data & $customer )

Method to create a new customer in the database.

Method to create a new customer in the database.

Parameters

$customer

Throws

WC_Data_Exception

Since

3.0.0

Implementation of

WC_Object_Data_Store_Interface::create()
public
# read( WC_Customer & $customer )

Method to read a customer object.

Method to read a customer object.

Parameters

$customer

Throws

Exception

Since

3.0.0

Implementation of

WC_Object_Data_Store_Interface::read()
public
# update( WC_Customer & $customer )

Updates a customer in the database.

Updates a customer in the database.

Parameters

$customer

Since

3.0.0

Implementation of

WC_Object_Data_Store_Interface::update()
public boolean
# delete( WC_Customer & $customer, array $args = array() )

Deletes a customer from the database.

Deletes a customer from the database.

Parameters

$customer
$args
Array of args to pass to the delete method.

Returns

boolean
result

Since

3.0.0

Implementation of

WC_Object_Data_Store_Interface::delete()
public WC_Order|false
# get_last_order( WC_Customer & $customer )

Gets the customers last order.

Gets the customers last order.

Parameters

$customer

Returns

WC_Order|false

Since

3.0.0

Implementation of

WC_Customer_Data_Store_Interface::get_last_order()
public integer
# get_order_count( WC_Customer & $customer )

Return the number of orders this customer has.

Return the number of orders this customer has.

Parameters

$customer

Returns

integer

Since

3.0.0

Implementation of

WC_Customer_Data_Store_Interface::get_order_count()
public float
# get_total_spent( WC_Customer & $customer )

Return how much money this customer has spent.

Return how much money this customer has spent.

Parameters

$customer

Returns

float

Since

3.0.0

Implementation of

WC_Customer_Data_Store_Interface::get_total_spent()
public array
# search_customers( string $term, integer|string $limit = '' )

Search customers and return customer IDs.

Search customers and return customer IDs.

Parameters

$term
$limit
@since 3.0.7

Returns

array

Methods inherited from WC_Data_Store_WP

add_meta(), delete_meta(), get_db_info(), get_internal_meta_keys(), get_props_to_update(), get_term_ids(), get_wp_query_args(), parse_date_for_wp_query(), prefix_key(), read_meta(), update_meta()

Properties summary

protected array $internal_meta_keys

Data stored in meta keys, but not considered "meta".

Data stored in meta keys, but not considered "meta".

Since

3.0.0
# array( 'locale', 'billing_postcode', 'billing_city', 'billing_address_1', 'billing_address_2', 'billing_state', 'billing_country', 'shipping_postcode', 'shipping_city', 'shipping_address_1', 'shipping_address_2', 'shipping_state', 'shipping_country', 'paying_customer', 'last_update', 'first_name', 'last_name', 'display_name', 'show_admin_bar_front', 'use_ssl', 'admin_color', 'rich_editing', 'comment_shortcuts', 'dismissed_wp_pointers', 'show_welcome_panel', 'session_tokens', 'nickname', 'description', 'billing_first_name', 'billing_last_name', 'billing_company', 'billing_phone', 'billing_email', 'shipping_first_name', 'shipping_last_name', 'shipping_company', 'wptests_capabilities', 'wptests_user_level', 'syntax_highlighting', '_order_count', '_money_spent', )
protected string $meta_type

Internal meta type used to store user data.

Internal meta type used to store user data.

# 'user'

Properties inherited from WC_Data_Store_WP

$object_id_field_for_meta

WooCommerce Code Reference API documentation generated by ApiGen