Skip to main content

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

alt

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;
}
NamedescriptionTypeDefault
actionTypeactivity the user wants to perform'no' ,'url' , 'popup' , 'scroll' ,'email' , 'phone' 'no'
openNewTabOpen a new tabbooleanfalse
urlpathstringnull
scrollToScroll tostringnull
topOffsetTop off setUnitValue{value:0 , unit:'px}
emailEmailstringnull
emailSubjectEmail subjectstringnull
phonePhone numberstringnull

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",

}