[WordPress] 外掛分享: VForce Extensions

首頁外掛目錄 › VForce Extensions
全新外掛
安裝啟用
尚無評分
2184 天前
最後更新
問題解決
WordPress 3.0.1+ v1.0.3 上架:2020-03-02

內容簡介

透過 WordPress 輕鬆管理 Vforce 整合,目前支援透過 Form Assembly 的投票表單和 Web 到 Case 表單,以及透過 Formidable 將產品新增到購物車的功能。

包含的函式:
- js/init-global.js:
此檔案實際上並無作用,只是為了與希望在每個頁面中可用的變數陣列一起傳遞到 ```php wp_localize_script()``` 函數。
- js/formidable/add-to-cart.js:
此腳本可讓您創建一個帶有 WooCommerce 產品下拉選單或單選按鈕的 Formidable 表單。 一旦使用者選擇產品並在表單上按下下一步,產品 ID 將會存儲在其瀏覽器中。 當他們完成表單時,會使用 Ajax 請求將其存入購物車。
- js/form-assembly/hide-ballot.js:
此腳本將根據名稱為 Ballot Cast 的輸入值的值來顯示或隱藏表單。 如果在頁面上找到該輸入,並且其值等於 Cast 或 cast ,則使用者將看到自定義消息而不是投票表單。 可以通過轉到插件設置(Vforce 擴展)並更改 Form Assembly Ballot Message 文本區域來自定義消息。 包括預設消息。
- js/form-assembly/web-to-case.js:
此功能將在嵌入到任何頁面上的表格中自動添加關聯 ID。 可以在插件設置中設置關聯 ID 。
- 全局變數:
每個頁面應該都可以存取名為 vforce_helper 的對象。 此對象包含來自設置面板的所有自定義變數。

請注意,上述內容翻譯工具僅提供簡易的轉譯,若有任何翻譯不符合上下文,還請您斟酌上下文後再行運用。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0.3) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「VForce Extensions」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Easily manage Vforce integrations through WordPress. Currently supports voting forms and web to case forms through Form Assembly. As well as adding products to a cart through Formidable.
Included Functions
js/init-global.js
This file doesn’t actually do anything. It only exists to be passed into the
php
wp_localize_script()
function along with an array of variables that we would like to be available to every page.
js/formidable/add-to-cart.js
This script allows you to create a formidable form with woocommerce products in a dropdown or radio buttons. Once the user chooses a product and clicks next on the form, the product id is saved in their browser. When they complete the form, an Ajax request is made to add the time to their cart.
js/form-assembly/hide-ballot.js
This script will show/hide a form based on the value of an input with title of Ballot Cast. If that input is found on the page and its value is equal to Cast or cast, then the user will see a custom message instead of the voting form. The message can be customized by going to the plugin settings (Vforce Extensions) and changing the Form Assembly Ballot Message textarea. A default message is included.
In order for this to work properly, please make sure to wrap the form in a div with the class of ballot-container.
E.g.
`html

[formassembly formid=50 server=https://virtual.tfaforms.net]
`

This way the form will be hidden by default and will either appear or show the message when page loads.
js/form-assembly/web-to-case.js
Automatically adds the association id to a Form Assembly contact form embedded on any page. The association id can be set in the plugin settings.
Global Variables
Every page should have access to an object called vforce_helper. This object contains all custom variables from the settings pane.
e.g.
`javascript

vforce_helper
{assocId: “”, faProductSelector: “item_meta[6]”, ballotCastMessage: “”}
`
This is accomplished by passing key/value pairs to the following function in the plugins functions.php file
`php

wp_localize_script( ‘init-global’, ‘vforce_helper’, array(
‘assocId’ => get_option(‘association_id’),
‘faProductSelector’ => get_option(‘form_assembly_product_selector’),
‘ballotCastMessage’ => get_option(‘form_assembly_ballot_message’)
)
`

文章
Filter
Apply Filters
Mastodon