This file contains hidden or 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_action( 'woocommerce_before_customer_object_save', function( $customer ) { | |
| static $already_updated = false; | |
| if ( $already_updated || ! is_checkout() ) { | |
| return; | |
| } | |
| $cart_items = WC()->cart->get_cart(); |
This file contains hidden or 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 // Trigger feeds when payment is on hold. | |
| * | |
| * By default, feeds are only triggered when the payment is processing or complete. | |
| * | |
| * Instructions: | |
| * 1. Install per https://gravitywiz.com/documentation/how-do-i-install-a-snippet/ | |
| * 2. Update `$payment_methods`, `$forms`, and `$do_not_process_feeds` accordingly. | |
| */ |
This file contains hidden or 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( 'gppa_get_batch_field_html', 'capture_acf_address', 10, 6 ); | |
| function capture_acf_address( $html, $field, $form, $fields, $entry_id, $hydrated_field ) { | |
| // Replace 5 with your form id and 3 with your ACF address field id | |
| if ( $form['id'] != 5 && $field['id'] != 3 ) { | |
| return $html; | |
| } | |
| $field_id = $field->id; | |
| $value_1 = isset( $_POST['input_' . $field_id . '.1'] ) ? $_POST['input_' . $field_id . '.1'] : ''; |
This file contains hidden or 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 | |
| class GPAA_Single_Line_Input { | |
| private $_args = array(); | |
| public function __construct( $args = array() ) { | |
| $this->_args = wp_parse_args( $args, array( | |
| 'form_id' => false, | |
| 'address_field_id' => false, |
This file contains hidden or 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( 'gppa_get_input_values', function ( $value, $field, $template, $objects ) { | |
| $parts = array_map( 'trim', explode( ',', $value ) ); | |
| $field_id = $field['id']; | |
| preg_match( '/^' . preg_quote($field_id, '/') . '\.(\d+)$/', $template, $matches ); | |
| $tag = $matches[1]; | |
| switch( $tag ) { | |
| case '1': // Street Address | |
| $value = $parts[9]; |
This file contains hidden or 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
| jQuery(document).ready(function($) { | |
| var onlyConvertOnMobile = false; // Change to false if you wish for all devices to use HTML5 datepicker | |
| var isMobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent); | |
| if ( isMobile || onlyConvertOnMobile === false ) { | |
| let $datepicker = $('#input_GFFORMID_1'); // Replace 1 with your field ID | |
| // Ensure Gravity Forms' Datepicker is Destroyed | |
| if ($datepicker.hasClass('hasDatepicker')) { |
This file contains hidden or 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 Google Sheets // Process Feed when Partial Entry is Saved. | |
| * | |
| * Process Google Sheet feeds when a partial entry is saved. | |
| */ | |
| add_action( 'gform_partialentries_post_entry_saved', 'send_to_google_sheet_on_partial_entry_saved', 10, 2 ); | |
| function send_to_google_sheet_on_partial_entry_saved( $partial_entry, $form ) { | |
| if ( function_exists( 'gp_google_sheets' ) ) { | |
| $partial_entry['status'] = 'partial'; |
This file contains hidden or 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 | |
| class GPML_Ajax_Upload { | |
| private $_args = array(); | |
| private $form_id; | |
| public function __construct( $args = array() ) { | |
| $this->_args = wp_parse_args( $args, array( |
This file contains hidden or 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 | |
| class GPML_Ajax_Upload { | |
| private $_args = array(); | |
| private $form_id; | |
| public function __construct( $args = array() ) { | |
| $this->_args = wp_parse_args( $args, array( | |
| 'default_entry_id' => 1, |