This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Paste this into your browser DevTools console while editing a form in Gravity Forms | |
// Load fast-xml-parser | |
jQuery.getScript( | |
"https://cdnjs.cloudflare.com/ajax/libs/fast-xml-parser/4.0.8/fxparser.js", | |
function () { | |
// Loop through HTML fields in window.form.fields | |
window.form.fields.forEach(function (field) { | |
if (field.type !== "html") { | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.table-of-contents { | |
position: sticky; | |
top: 2.25rem; | |
overflow-y: auto; | |
max-height: calc(100vh - 2.25rem); | |
margin-top: 2.25rem; | |
padding-bottom: 2.25rem; | |
box-sizing: border-box; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('woocommerce_checkout_get_value', function( $input, $key ) { | |
// Get current items in the cart. | |
$cart_items = WC()->cart->get_cart(); | |
// Loop through cart items. | |
foreach ( $cart_items as $cart_item ) { | |
// Convert to a GSPC Cart Item | |
$gspc_cart_item = \GS_Product_Configurator\WC_Cart_Item::from( $cart_item ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Note: See https://gravitywiz.com/documentation/how-do-i-install-a-snippet/ for details on how to install snippets. | |
* | |
* Normally, GP eCommerce Fields Tax fields will be treated as Gravity Forms products when passed to WC Product Add-ons. | |
* If WooCommerce is configured to handle taxes, passing the tax fields will result in double-taxation. | |
* | |
* This snippet prevents the tax fields/product from being added to WooCommerce cart. | |
* | |
* Use case: Display the tax on the product page to help show the customer a tax |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Gravity Shop // GS Product Configurator // Populate Gravity Forms field with WooCommerce Order ID | |
* | |
* Populate fields in a Gravity Form that is linked to a WooCommerce product using GS Product Configurator | |
* with the WooCommerce order ID after checking out. | |
* | |
* Credit: Rochelle Victor (https://github.com/rochekaid) | |
* | |
* Instructions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Gravity Wiz // Gravity Forms OpenAI // Add separator to prompt | |
* https://gravitywiz.com/path/to/article/ | |
* | |
* Adds a separator to a prompt if needed by a fine-tuned model. | |
* | |
* Instructions: | |
* 1. Customize $model and $sep accordingly. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Gravity Wiz // Gravity Forms // Set Number of List Field Rows by Field Value | |
* | |
* Add/remove list field rows automatically based on the value entered in the specified field. Removes the add/remove | |
* that normally buttons next to List field rows. | |
* | |
* @version 1.1 | |
* @author David Smith <david@gravitywiz.com> | |
* @license GPL-2.0+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This template is based off of gp-nested-forms/templates/nested-entries.php | |
* | |
* Any modifications from the original have been noted. | |
* | |
* ==== Installation: ==== | |
* | |
* 1. Place this file in your theme under gp-nested-forms/nested-entries.php. The full path should look something like | |
* wp-content/themes/YOUR-THEME/gp-nested-forms/nested-entries.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Gravity Perks // GP Notification Scheduler // Set Recurring Schedule to Every 6 Months | |
* https://gravitywiz.com/documentation/gravity-forms-notification-scheduler | |
* | |
* Instructions: | |
* * Install snippet per https://gravitywiz.com/documentation/how-do-i-install-a-snippet/ | |
* * Update $form_id, $notification_id, and if required, $desired_time | |
*/ | |
add_filter( 'gpns_schedule_timestamp', function ( $timestamp, $notification, $entry, $is_recurring, $current_time ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Gravity Perks // GP Address Autocomplete // Show Cities as Results | |
* https://gravitywiz.com/documentation/gravity-forms-address-autocomplete | |
* | |
* Instructions: | |
* 1. Install our free Custom JavaScript for Gravity Forms plugin. | |
* Download the plugin here: https://gravitywiz.com/gravity-forms-custom-javascript/ | |
* 2. Copy and paste the snippet into the editor of the Custom Javascript for Gravity Forms plugin. | |
* 3. Install accompanying gpaa-autocomplete-cities.php snippet | |
*/ |
NewerOlder