Skip to content

Instantly share code, notes, and snippets.

Clifton Griffin clifgriffin

Block or report user

Report or block clifgriffin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@clifgriffin
clifgriffin / thank-you-page.php
Created Nov 9, 2019
Change thank you page text for Checkout for WooCommerce.
View thank-you-page.php
<?php
// Place in functions.php
// Do NOT include opening PHP tag (<?php)
add_filter( 'cfw_before_thank_you_customer_information', function() {
return 'Please ensure your phone and shipping address is correct to ensure timely &amp; accurate delivery.';
} );
add_filter( 'cfw_order_updates_text', function( $order ) {
return sprintf( 'We'll send a confirmation to %s when your items ship. You will also receive SMS Notification on %s about the delivery status.', $order->get_billing_email(), $order->get_billing_phone() );
@clifgriffin
clifgriffin / always-show-cart-on-mobile.css
Created Nov 6, 2019
Always show cart summary expanded on mobile with Checkout for WooCommerce
View always-show-cart-on-mobile.css
#cfw-cart-details-collapse-wrap {
display: block !important;
}
#cfw-cart-details-review-bar {
display: none !important;
}
@clifgriffin
clifgriffin / custom-order-status-icons.php
Created Nov 4, 2019
How to setup icons for WooCommerce statuses on the CheckoutWC thank you page.
View custom-order-status-icons.php
<?php
// Do NOT include the opening php tag.
// Place in your theme's functions.php file
// Default WooCommerce order statuses
// - wc-pending
// - wc-processing
// - wc-on-hold
// - wc-completed
// - wc-cancelled
@clifgriffin
clifgriffin / move-billing-address-above-payment-gateways.php
Created Oct 21, 2019
How to Move Billing Address Above Payment Gateways with Checkout for WooCommerce
View move-billing-address-above-payment-gateways.php
<?php
// Do NOT include the opening php tag.
// Place in your theme's functions.php file
add_action( 'cfw_payment_tab_before_content', 'reorder_payment_tab' );
function reorder_payment_tab() {
remove_action( 'cfw_payment_tab_content', 'cfw_payment_methods', 10 );
remove_action( 'cfw_payment_tab_content', 'cfw_payment_tab_content_billing_address', 20 );
@clifgriffin
clifgriffin / show-credit-card-icons-mobile.css
Last active Sep 23, 2019
Show credit card icons on mobile with Checkout for WooCommerce.
View show-credit-card-icons-mobile.css
<!--- Add to Settings > CheckoutWC > Design > Custom CSS -->
@media(max-width: 600px) {
#checkout #cfw-billing-methods .payment_method_icons {
display: flex !important;
}
}
@clifgriffin
clifgriffin / custom-header.php
Last active Sep 17, 2019
A simple example of how to add a custom header to Checkout for WooCommerce.
View custom-header.php
<?php
// Do NOT include the opening php tag.
// Place in your theme's functions.php file
add_action( 'cfw_before_header', function() {
?>
<!-- Some custom CSS for your new header -->
<style type="text/css">
#cfw-header {
display: none;
@clifgriffin
clifgriffin / change-header-link.php
Last active Sep 6, 2019
How to change header title / logo link URL for Checkout for WooCommerce.
View change-header-link.php
@clifgriffin
clifgriffin / address-autocomplete-country-restrictions.php
Last active Aug 22, 2019
Add country restrictions to address autocomplete for Checkout for WooCommerce.
View address-autocomplete-country-restrictions.php
<?php
// Do NOT include the opening php tag.
// Place in your theme's functions.php file
// Restrict address autocomplete shipping countries to US
// NOTE: Google only allows up to 5 country restrictions
add_filter( 'cfw_address_autocomplete_shipping_countries', function() {
return array( 'us' );
} );
@clifgriffin
clifgriffin / reorder-address-fields.php
Created Aug 21, 2019
How to reorder address fields for Checkout for WooCommerce.
View reorder-address-fields.php
<?php
// Do NOT include the opening php tag.
// Place in your theme's functions.php file
add_action( 'woocommerce_default_address_fields', 'cfw_reorder_address_fields', 100000 + 10 );
function cfw_reorder_address_fields( $fields ) {
$fields['city']['priority'] = 50;
$fields['city']['columns'] = 4;
$fields['state']['priority'] = 60;
@clifgriffin
clifgriffin / highlight-countries.php
Created Jul 25, 2019
How to highlight certain countries in countries select dropdown for Checkout for WooCommerce.
View highlight-countries.php
<?php
// Do NOT include the opening php tag.
// Place in your theme's functions.php file
add_filter( 'cfw_highlighted_countries', function( $highlighted_countries ) {
$highlighted_countries[] = 'US';
$highlighted_countries[] = 'GB'; // UK
return $highlighted_countries;
} );
You can’t perform that action at this time.