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
<script type="text/javascript"> | |
(function($){ | |
function toggleAddToCart( $form, show ) { | |
if ( typeof $form === 'undefined' || !$form.length ) { | |
return; | |
} | |
if ( show !== true ) { | |
show = 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
<script type="text/javascript"> | |
(function($){ | |
$(document).bind('gform_post_render', function(e, formId, currentFormPage) { | |
var formSelector = '#gform_' + formId; | |
var $form = $(formSelector); | |
if ( $form.data('configurator-init') !== true ) { | |
// Add the preview layers | |
$(formSelector + ' .gform_body .gfield.image-choices-field.config-layer').each(function(i, el){ |
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
<script type="text/javascript"> | |
(function($){ | |
function scrollableImageChoices( formId ) { | |
var $fields = ( typeof formId !== 'undefined') ? $('#gform_' + formId + ' .image-choices-field') : $('form[id^="gform_"] .image-choices-field'); | |
if (!$fields.length) { | |
return; | |
} | |
$fields.each(function(){ | |
var $field = $(this); |
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
<script type="text/javascript"> | |
window.gform_format_option_label_original = window.gform_format_option_label; | |
window.gform_format_option_label = function(fullLabel, fieldLabel, priceLabel, selectedPrice, price, formId, fieldId, index) { | |
// Update any of the variables to format, Eg; | |
// priceLabel = ""; | |
return window.gform_format_option_label_original(fullLabel, fieldLabel, priceLabel, selectedPrice, price, formId, fieldId, index); | |
}; | |
</script> |
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
<script type="text/javascript"> | |
window.jetsloth_add_filter('gfic_choice_price', function(priceLabel, selectedPrice, price, formId, fieldId, index){ | |
return ''; | |
}); | |
</script> |
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( 'gform_post_data', 'gform_set_post_meta_to_image_choices_urls', 10, 3 ); | |
function gform_set_post_meta_to_image_choices_urls( $post_data, $form, $entry ) { | |
foreach( $form['fields'] as $field ) { | |
$value = RGFormsModel::get_lead_field_value( $entry, $field ); | |
if ( $field->type != 'post_custom_field' || !property_exists($field, 'postCustomFieldName') || empty($field->postCustomFieldName) || !property_exists($field, 'imageChoices_enableImages') || empty($field->imageChoices_enableImages) || !isset($post_data['post_custom_fields'][$field->postCustomFieldName]) ) { | |
// if it's not a custom field, doesn't use image choices, or no custom field name configured, skip |
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( 'gpecf_order_sumary_markup', 'get_custom_order_summary_markup', 10, 6 ); | |
function get_custom_order_summary_markup( $markup, $order, $form, $entry, $order_summary, $labels ) { | |
ob_start(); | |
$form_id = rgar($form, "id"); | |
?> | |
<table class="gpecf-order-summary" cellspacing="0" width="100%" style="<?php gp_ecommerce_fields()->style( '.order-summary' ); ?>"> | |
<thead> | |
<tr> |
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
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;700&display=swap'); | |
/*To get the produc options fields working, you need to add a product field. */ | |
/*However we don't want to show that in this example so lets hide it with CSS.*/ | |
.hidden { | |
display: none; | |
visibility: hidden; | |
pointer-events: none; | |
} | |
/*Dark field lables*/ | |
.top_label label.gfield_label { |
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
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;700&display=swap'); | |
/*To get the produc options fields working, you need to add a product field. */ | |
/*However we don't want to show that in this example so lets hide it with CSS.*/ | |
.hidden { | |
display: none; | |
visibility: hidden; | |
pointer-events: none; | |
} | |
/*Background Wrapper*/ | |
.gform_wrapper { |
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_input_choices", "gppa_populate_featured_image_choices", 100, 3 ); | |
function gppa_populate_featured_image_choices( $choices, $field, $objects ) { | |
if ( ! property_exists($field, 'imageChoices_enableImages') || ! $field->imageChoices_enableImages ) { | |
return $choices; | |
} | |
$i = 0; |