Skip to content

Instantly share code, notes, and snippets.

View tuanbbhero's full-sized avatar

Tuan Phan tuanbbhero

View GitHub Profile
@tuanbbhero
tuanbbhero / Auto Click Next Page in Caldera Forms
Created January 30, 2019 02:25
Auto click Next Page in Multi-Page Caldera Forms.
/** Auto click Next Page in Multi-Page Caldera Forms */
jQuery( document ).ready( function( $ ) {
//find highest page
var highest_page = 1;
//IMPORTANT: Change form ID to match your form
$( '.CF5c51040f84172 .caldera-form-page' ).each( function () {
highest_page = $(this).data('formpage');
});
@tuanbbhero
tuanbbhero / Change PlaceHolder Select State at Checkout Page
Created January 30, 2019 05:39
Change PlaceHolder: Select State on Checkout Page - WooCommerce. Insert into functions.php or use Code Snippets Plugin
add_filter( 'woocommerce_checkout_fields' , 'kl_edit_checkout_fields' );
function kl_edit_checkout_fields( $fields ) {
$fields['billing']['billing_state']['placeholder'] = 'Select State at Billing';
$fields['shipping']['shipping_state']['placeholder'] = 'Select State at Shipping';
return $fields;
}
@tuanbbhero
tuanbbhero / MH Corporate Lite Styling
Created February 15, 2019 02:31
CSS Styling for MH Corporate Lite Theme by MH Themes.
/* Menu item hover and current color */
.main-nav li a:hover {
color: red;
}
.main-nav .current-menu-item a {
color: red;
}
/* Footer title border color */
.footer-widget-title {
@tuanbbhero
tuanbbhero / Remove & Customize Built with Storefront & WooCommerce
Created February 25, 2019 01:56
How to Hide, Remove, Customize Built with Storefront & WooCommerce in WooCommerce StoreFront Theme
/* HIDE with CSS */
/* Insert into Appearance > Customize > Additional CSS */
.site-info a {
display: none;
}
/* REMOVE with Action */
/* Insert into Appearance > Editor > fuctions.php or use Code Snippets Plugin */
remove_action(storefront_footer, storefront_credit,20);
/* CUSTOMIZE */
@tuanbbhero
tuanbbhero / Hide Search Bar WooCommerce StoreFront
Created February 25, 2019 02:15
Hide Search Bar WooCommerce StoreFront in Entire Site, Specific Pages, Archives...
/* Hide Search Bar in WooCommerce StoreFront */
/* Insert these codes into Appearance > Customize > Additional CSS */
/* Entire Site */
.site-header .site-search {
display: none;
}
/* Product Page */
.site-header .site-search {
display: none;
@tuanbbhero
tuanbbhero / Change Quantity Arrow to Minus Plus WooCommerce
Created February 25, 2019 02:45
How to Change Quantity Arrow to Minus Plus icon in WooCommerce
// From Businessbloomer.com
// 1. Show Buttons
add_action( 'woocommerce_before_add_to_cart_quantity', 'bbloomer_display_quantity_plus' );
function bbloomer_display_quantity_plus() {
echo '<button type="button" class="plus" >+</button>';
}
add_action( 'woocommerce_after_add_to_cart_quantity', 'bbloomer_display_quantity_minus' );
@tuanbbhero
tuanbbhero / Remove Short Description in WooCommerce Backend
Created February 26, 2019 01:56
Remove Short Description in WooCommerce Backend
add_action( 'add_meta_boxes_product', 'bbloomer_remove_metaboxes_edit_product', 9999 );
function bbloomer_remove_metaboxes_edit_product() {
// e.g. remove short description
remove_meta_box( 'postexcerpt', 'product', 'normal' );
}
@tuanbbhero
tuanbbhero / You Only Need $$$ to Get Free Shipping!
Created February 26, 2019 09:40
You Only Need $$$ to Get Free Shipping in WooCommerce
/**
From BusinessBloomer.com
*/
add_action( 'woocommerce_before_cart', 'bbloomer_free_shipping_cart_notice_zones' );
function bbloomer_free_shipping_cart_notice_zones() {
global $woocommerce;
@tuanbbhero
tuanbbhero / Show Number of Products Sold
Created February 26, 2019 22:25
Show Number of Products Sold on WooCommerce Product Page
add_action( 'woocommerce_single_product_summary', 'bbloomer_product_sold_count', 11 );
function bbloomer_product_sold_count() {
global $product;
$units_sold = get_post_meta( $product->get_id(), 'total_sales', true );
if ( $units_sold ) echo '<p>' . sprintf( __( 'Products Sold: %s', 'woocommerce' ), $units_sold ) . '</p>';
}
@tuanbbhero
tuanbbhero / Remove Default Sorting
Created February 27, 2019 23:09
Remove Default Sorting in WooCommerce
remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 );