Action
A setting of type action
Các hành động được sử dụng để thực hiện các tác vụ cụ thể dựa trên yêu cầu của người dùng là:
Go to URL: Chuyển hướng người dùng đến một liên kết mới. Scroll to: Cuộn trang đến một vị trí cụ thể trên trang web. Send Email: Gửi một email đến một địa chỉ email cụ thể với chủ đề và nội dung được xác định. Call Phone: Khởi tạo cuộc gọi điện thoại đến một số điện thoại cụ thể.
Setting
{
id: "action",
type: "action",
label: "action",
sectionType:'advanced',
default: {},
}
Giao diện
Khi truy cập giá trị action type setting, ddữ liệu được trả về dưới dạng :
{settings.action}
Output
Entity
export interface ActionItem extends Partial<ActionItemValidate> {
actionType: ActionType;
emailSubject?: string;
emailBody?: string;
url?: string;
openNewTab?: boolean;
scrollTo?: string;
}
Name | description | Type | Default |
---|---|---|---|
actionType | activity the user wants to perform | 'no' ,'url' , 'popup' , 'scroll' ,'email' , 'phone' | 'no' |
openNewTab | Open a new tab | boolean | false |
url | path | string | null |
scrollTo | Scroll to | string | null |
topOffset | Top off set | UnitValue | {value:0 , unit:'px} |
string | null | ||
emailSubject | Email subject | string | null |
phone | Phone number | string | null |
Ví dụ
{
"actionType": "phone",
"openNewTab": true,
"url": "https://shopify.dev/docs/themes/architecture/settings/input-settings#video_url",
"topOffset": {
"value": 43,
"unit": "px"
},
"scrollTo": "section_2342343"
"email": "xotiny@gmail.com",
"emailSubject": "Hello",
"phone": "0123456789",
}