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_Session

WC Customer Data Store which stores the data in session.

WC_Data_Store_WP
Extended by WC_Customer_Data_Store_Session 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-session.php

Methods summary

public
# create( WC_Customer & $customer )

Simply update the session.

Simply update the session.

Parameters

$customer

Implementation of

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

Simply update the session.

Simply update the session.

Parameters

$customer

Implementation of

WC_Object_Data_Store_Interface::update()
public
# save_to_session( WC_Customer $customer )

Saves all customer data to the session.

Saves all customer data to the session.

Parameters

$customer
public
# read( WC_Customer & $customer )

Read customer data from the session unless the user has logged in, in which case the stored ID will differ from the actual ID.

Read customer data from the session unless the user has logged in, in which case the stored ID will differ from the actual ID.

Parameters

$customer

Since

3.0.0

Implementation of

WC_Object_Data_Store_Interface::read()
protected
# set_defaults( WC_Customer & $customer )

Load default values if props are unset.

Load default values if props are unset.

Parameters

$customer
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()

Methods inherited from WC_Data_Store_WP

add_meta(), delete_meta(), exclude_internal_meta_keys(), 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 $session_keys

Keys which are also stored in a session (so we can make sure they get updated...)

Keys which are also stored in a session (so we can make sure they get updated...)

# array( 'id', 'date_modified', 'billing_postcode', 'billing_city', 'billing_address_1', 'billing_address', 'billing_address_2', 'billing_state', 'billing_country', 'shipping_postcode', 'shipping_city', 'shipping_address_1', 'shipping_address', 'shipping_address_2', 'shipping_state', 'shipping_country', 'is_vat_exempt', 'calculated_shipping', 'billing_first_name', 'billing_last_name', 'billing_company', 'billing_phone', 'billing_email', 'shipping_first_name', 'shipping_last_name', 'shipping_company', )

Properties inherited from WC_Data_Store_WP

$internal_meta_keys, $meta_type, $object_id_field_for_meta

WooCommerce Code Reference API documentation generated by ApiGen