VForce Extensions

Vforce helper tool. To be used by any organization on the Vforce platform.

Author:Virtual Inc (profile at wordpress.org)
WordPress version required:3.0.1
WordPress version tested:5.3.8
Plugin version:1.0.3
Added to WordPress repository:03-03-2020
Last updated:25-03-2020
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
Rating, %:0
Rated by:0
Plugin URI:
Total downloads:516
plugin download
Click to start download

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’)
)
`


ChangeLog