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 | |
/** | |
* Enable ACR cart tracking without published emails | |
* | |
* Add to your child theme's functions.php file or to WP Admin > CheckoutWC > Advanced > Scripts > PHP Snippets | |
* Do NOT include the opening PHP tag above (<?php) | |
*/ | |
add_filter( 'cfw_acr_track_cart_without_emails', '__return_true' ); |
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 | |
/* | |
* In CheckoutWC's Delivery method, hide the Shipping option completely when at least | |
* one product in the cart is assigned to a specific category. | |
* | |
* @author Obi Juan <hola@obijuan.dev> | |
* @link https://obijuan.dev | |
*/ | |
/* |
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 | |
/** | |
* Output custom HTML below the CheckoutWC cart summary | |
*/ | |
add_action( 'cfw_after_cart_summary', function() { | |
?> | |
<div class="example-container-class"> | |
<h2>A heading!</h2> | |
<p>A paragraph tag.</p> | |
<p>A paragraph tag with inline PHP: <?php echo 'Inline PHP!'; ?></p> |
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 | |
/** | |
* The following code MUST be deployed in an MU plugin to work | |
*/ | |
add_action( 'cfw_init_ab_tests', function() { | |
cfw_register_ab_test( 'cfw_disabled', 'example_set_cfw_disabled' ); | |
// To enable the test progamatically, you would use this call: | |
cfw_activate_ab_test( 'cfw_disabled' ); |
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( 'cfw_checkout_customer_info_tab', function () { | |
if ( function_exists( 'autoship_cart_has_valid_autoship_items' ) && autoship_cart_has_valid_autoship_items() ) { | |
remove_action( 'cfw_checkout_customer_info_tab', 'cfw_payment_request_buttons', 10 ); | |
} | |
}, 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 | |
add_filter( 'woocommerce_default_address_fields', 'custom_override_default_address_fields', 100000 + 100 ); | |
function custom_override_default_address_fields( $fields ) { | |
$fields['country']['class'] = array( 'cfw-force-hidden' ); | |
$fields['country']['columns'] = 0; | |
$fields['postcode']['columns'] = 6; | |
$fields['state']['columns'] = 6; | |
return $fields; |
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( 'cfw_display_bump', function( $display_bump ) { | |
if ( ! class_exists( '\\WC_Subscriptions_Cart' ) ) { | |
return $display_bump; | |
} | |
if ( \WC_Subscriptions_Cart::cart_contains_subscription() ) { | |
return false; | |
} |
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 | |
function custom_output_pickup_instructions( \WC_Order $order ) { | |
$location = $order->get_meta( '_cfw_pickup_location', true ); | |
if ( empty( $location ) ) { | |
return; | |
} | |
$raw_address = get_post_meta( $location, 'cfw_pl_address', true ); |
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( 'cfw_field_data_persistence_excludes', function( $excludes ) { | |
$excludes[] = '#terms'; | |
return $excludes; | |
} ); |
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 | |
// 2 - Above Mobile Coupons | |
// 7 - Above Payment Methods | |
// 15 - Above Billing Address Group | |
// 27 - Above Order Notes Field | |
// 35 - Above Terms and Conditions | |
add_action( 'cfw_checkout_payment_method_tab', function() { | |
echo '<h2>'Your Disclaimer and Other HTML</h2>'; | |
}, 2 ); |
NewerOlder