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
add_filter( 'gform_export_fields', 'custom_add_wc_order_fields', 10, 1 ); | |
add_filter( 'gform_export_field_value', 'custom_export_wc_order_fields', 10, 4 ); | |
function custom_add_wc_order_fields( $form ) { | |
array_push( $form['fields'], array( | |
'id' => 'woocommerce_billing_address_1', | |
'label' => __( 'WooCommerce Billing Address 1', 'wc_gf_addons' ) | |
) ); | |
array_push( $form['fields'], array( |
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
add_filter( 'woocommerce_add_cart_item_data', 'remove_adjust_for_tax_display', 10, 1 ); | |
add_filter( 'woocommerce_get_cart_item_from_session', 'remove_adjust_for_tax_display', 10, 1 ); | |
add_filter( 'woocommerce_get_item_data', 'remove_adjust_for_tax_display', 10, 1 ); | |
add_filter( 'woocommerce_add_cart_item', 'remove_adjust_for_tax_display', 10, 1 ); | |
add_action( 'woocommerce_checkout_create_order_line_item', 'remove_adjust_for_tax_display', 10, 1 ); | |
add_filter( 'woocommerce_add_to_cart_validation', 'remove_adjust_for_tax_display', 99, 1 ); | |
function remove_adjust_for_tax_display( $arg ) { | |
if ( isset( $_POST['gform_old_submit'] ) ) { |
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
add_filter( 'woocommerce_gforms_get_item_data', function ( $data, $field, $lead, $form_meta ) { | |
if ( strpos( $data['display'], '(' ) !== false && strpos( $data['display'], ')' ) !== false ) { | |
$data['display'] = substr( $data['display'], 0, strpos( $data['display'], '(' ) ); | |
} | |
return $data; | |
}, 10, 4 ); |
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
add_filter( 'woocommerce_gforms_get_product_form_data', 'woocommerce_gforms_get_product_form_data_for_category', 10, 2 ); | |
function woocommerce_gforms_get_product_form_data_for_category( $default_data, $product_id ) { | |
$products_to_exclude = array(); | |
//uncomment the following line and modify the 10 to a product ID you need to exclude from having this form. | |
//you can add more if needed. | |
//$products_to_exclude[] = 10; |
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
add_filter( 'woocommerce_dynamic_pricing_process_product_discounts', 'dynamic_pricing_is_product_eligible', 10, 1 ); | |
function dynamic_pricing_is_product_eligible( $apply ) { | |
//Change these to the codes that should disable dynamic pricing. Add or remove as needed. | |
$coupon_codes = array( | |
'cart discount', | |
'another code', | |
'third code' | |
); |
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
class WC_Dynamic_Pricing_Product_Addons_Compatibility { | |
private static $instance; | |
public static function register() { | |
if ( self::$instance == null ) { | |
self::$instance = new WC_Dynamic_Pricing_Product_Addons_Compatibility(); | |
} |
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 | |
/** | |
* Cart item data (when outputting non-flat) | |
* | |
* This template can be overridden by copying it to yourtheme/woocommerce/cart/cart-item-data.php. | |
* | |
* HOWEVER, on occasion WooCommerce will need to update template files and you | |
* (the theme developer) will need to copy the new files to your theme to | |
* maintain compatibility. We try to do this as little as possible, but it does | |
* happen. When this occurs the version of the template file will be bumped and |
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_action( 'wp_enqueue_scripts', 'add_gravity_forms_scripts' ); | |
function add_gravity_forms_scripts() { | |
if ( ! class_exists( 'WC_GFPA_Main' ) ) { | |
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
jQuery( document ).ready( function($) { | |
$.fn.init_addon_totals = function() { | |
function isGroupedMixedProductType() { | |
var group = $( '.product-type-grouped' ), | |
subs = 0, | |
simple = 0; | |
if ( group.length ) { |
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
(function($) { | |
$(document).ready(function() { | |
$("input[type=radio]").click(function() { | |
// Get the storedValue | |
var previousValue = $(this).data('storedValue'); | |
// if previousValue = true then | |
// Step 1: toggle radio button check mark. | |
// Step 2: save data-StoredValue as false to indicate radio button is unchecked. | |
if (previousValue) { | |
$(this).prop('checked', !previousValue); |