Customers

ชื่อเรื่อง

OldNew
11Customers

Permalink

OldNew
11customers

เนื้อหา

OldNew
11# Customers
2
3Customers is a collection of users that can sign in to your website for accessing a history of purchases etc.
4
5It is not mandatory to have a customer account in order to make purchases. If a customer registers an account after they have been making purchases as guests they will be able to access their purchase history if it has the same email address.
6
7## Entity Object
8
9```php
10$customer = new ent_customer();
11$customer->data['email'] = 'user@email.com';
12$customer->data['firstname'] = 'John';
13$customer->data['lastname'] = 'Doe';
14$customer->save();
15```
16
17## Reference Model
18
19```php
20echo reference::customer(123)->firstname;
21```
22
23## Database Query
24
25```php
26$query = database::query(
27 "select * from ". DB_TABLE_PREFIX ."customers
28 where id = ". (int)$customer_id ."
29 limit 1;"
30);
31
32$customer = database::fetch($query);
33```

Edited by tim on 22 ม.ค. 2024 at 14:17

View code on GitHub