LemonStand Documentation

Shop_Customer

The Shop_Customer class represents a customer. It has fields for accessing a customer's name, billing and shipping address and a list of customer orders.

Parent class: Db_ActiveRecord

Usually you will not need to create instances in the Shop_Customer class. A reference to a currently logged in customer is available through the $customer field of the Cms_Controller class. You can access this field from your pages, partials and templates code in the following manner: $this->customer.

Class fields

  • $first_name – customer first name
  • $last_name – customer last name
  • $email – customer email address
  • $company – customer company
  • $phone – customer phone
  • $billing_state – customer billing state. An object of Shop_CountryState class.
  • $billing_country - customer billing country. An object of Shop_Country class.
  • $billing_street_addr – customer billing street address
  • $billing_city – customer billing city
  • $billing_zip – customer billing ZIP code
  • $shipping_first_name – shipping first name
  • $shipping_last_name – shipping last name
  • $shipping_company – shipping company
  • $shipping_phone – shipping phone
  • $shipping_state - customer shipping state. An object of Shop_CountryState class.
  • $shipping_country - customer shipping country. An object of Shop_Country class.
  • $shipping_street_addr – shipping street address
  • $shipping_city – shipping city
  • $shipping_zip – shipping ZIP code
  • $guest – the customer guest indicator. This field has value 1 for non-registered customers, who made an order in guest mode.
  • $orders – a list of customer orders. An object of the Db_DataCollection class. Each element of the collection is an instance of the Shop_Order class.
  • $group - a customer group the customer belongs to. An object of the Shop_CustomerGroup class.

See also:

Next: Shop_CustomerGroup
Previous: Shop_CustomGroup
Return to Reference