Skip to content

Instantly share code, notes, and snippets.

View geekontheroad's full-sized avatar

geekontheroad

View GitHub Profile
/**
* This is a JavaScript Snippet for the Gravity Forms Live Summary Pro add-on.
* It allows you to overwrite the dispplayed total in the summary
*
* @param string total_formatted This is the formatted total according to the form currency
* @param string total_not_formatted This is the non formatted total. Use this for any calculations
* @param string formId This is the current form id
* @param string type This is the type of the summary and will either be side or the summary field ID
*
* @return string Return the HTML for the total to display
<?php // dont copy this line
/**
* This snippet is written for the Gravity EU VAT plugin ( https://geekontheroad.com/eu-vat-for-gravity-forms )
* It allows you to apply reverse charge tax for valid tax number of the default country
* This snippet is compatible with GF EU VAT v1.0.8.3 and higher
*
* INSTRUCTIONS:
* Copy/Paste the below code to your functions.php or code snippet plugin
* Complete the configuration part at the bottom of this code
*
<?php // don't copy this first line
/**
* This snippet is written for the Gravity EU VAT plugin ( https://geekontheroad.com/eu-vat-for-gravity-forms )
* It allows you to overwrite the default country information on a form basis. This overwrites the default tax country set in the settings
* This snippet is compatible with GF EU VAT v1.0.8.2 and higher
*
* INSTRUCTIONS:
* Copy/Paste the below code to your functions.php or code snippet plugin
* Complete the configuration part at the bottom of this code
*
<?php // don't copy this
/**
* This is a snippet for the Gravity Live Summary Pro addon (http://geekontheroad.com/live-summary-for-gravity-forms/)
*
* It will modify the columns displayed in the live summary mergetag by modifying the underlying templates
* In this case it will remove the QTY and UNIT columns from the live summary mergetag
*
* By Default this code will apply to all forms but it can be limited by adding form-ids to the allowed_forms array at the top of the function.
*
@geekontheroad
geekontheroad / gravity-view-add-entry-notes-new-row.php
Last active February 7, 2024 03:32
This snippet will add an extra row for each row in the gravity view table. This extra row will have the entry notes in an unordered list.
<?php
add_action('gravityview/template/table/cells/after', function ($context) {
$view = $context->view;
$view_id = $view->ID;
if ($view_id !== 140) {
return;
}
<?php
/**
* Snippet For Gravity Perks Google Sheets
*
* Description: Create a daily spreadsheet for your feed. The spreadsheet will be created after the first entry of that day.
*
* Instructions: Copy this code to your functions.php and enter your form id and feed ids at the bottom in the configuration section
*
* @author Johan d'Hollander
* @link https://geekontheroad.com
<?php
/**
* Geek on the Road // GP Nested Forms
*
* Description: Populate child entries from one parent form into another parent form with a different child form
* Version: 0.1
* Author: Johan d'Hollander
* Author URI: https://geekontheroad.com
*
@geekontheroad
geekontheroad / euvat-hide-field-description.php
Last active August 18, 2023 13:39
Hide the description of the EU VAT field when outside of EU
<?php
/**
* This snippet is meant for the EU VAT for Gravity Forms addon
* It will hide the EU VAT field description when a country outside of Europe is selected
*
* INSTRUCTIONS
* Copy to your functions.php or code snippet plugin. Dont copy the starting <?php tags
*
* @author Johan d'Hollander
* @link https://geekontheroad.com
@geekontheroad
geekontheroad / default_to_base_country_vat.php
Last active August 11, 2023 04:33
This snippet is made for the EU VAT for Gravity Forms. It can apply the tax rate of the default country to all other EU countries.
<?php
/**
* Snippet to apply the tax rate of the base country to ALL EU countries
*
* @param Int $rate
* @param string $country_code the 2 digit ISO code of the country *
* @return Int $rate
* @version 1.0
* @link https://geekontheroad.com/eu-vat-for-gravity-forms/
@geekontheroad
geekontheroad / add-suffix-or-prefix-to-value-in-summary.html
Last active July 17, 2023 07:40
Add a suffix or prefix to the Gravity forms Live Summary
<!----
* EXAMPLE 1: ADD SUFFIX TO A VALUE IN THE GF LIVE SUMMARY
*
* The below code can be used to add a suffix to any field in the Gravity Forms Summary.
* IMPORTANT: You need the Live Summary for Gravity forms addon with a minimum version of 1.1.14.1 installed
*
* INSTRUCTIONS
* 1. Add a new HTML field to your form and copy the code (including <script> tags) to the html field
* 2. Update the fieldsIds array with a comma separated list of your fields that need a suffix.
* 3. Update the suffix variable to your desired suffix