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_action( 'woocommerce_checkout_process', 'wc_minimum_order_amount' ); | |
add_action( 'woocommerce_before_cart' , 'wc_minimum_order_amount' ); | |
function wc_minimum_order_amount() { | |
// Set this variable to specify a minimum order value | |
$minimum = 50; | |
if ( WC()->cart->total < $minimum ) { | |
if( is_cart() ) { |
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 | |
/** | |
* Sell only in Minas Gerais. Brazil | |
*/ | |
function wc_sell_only_states( $states ) { | |
$states['BR'] = array( | |
'MG' => __( 'Minas Gerais', 'woocommerce' ), | |
); | |
return $states; |
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 autoset_featured() { | |
global $post; | |
$already_has_thumb = has_post_thumbnail($post->ID); | |
if (!$already_has_thumb) { | |
$attached_image = get_children( "post_parent=$post->ID&post_type=attachment&post_mime_type=image&numberposts=1" ); | |
if ($attached_image) { | |
foreach ($attached_image as $attachment_id => $attachment) { | |
set_post_thumbnail($post->ID, $attachment_id); | |
} |
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_to_cart_redirect', 'wc_custom_cart_redirect' ); | |
function wc_custom_cart_redirect() { | |
return get_permalink( wc_get_page_id( 'shop' ) ); | |
} |
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
/* START Make the cart table responsive */ | |
/* http://css-tricks.com/responsive-data-tables/ */ | |
/* http://www.jeremycarter.com.au/optimising-woocommerce-checkout-for-mobile/ */ | |
@media screen and (max-width: 600px) { | |
/* Force table to not be like tables anymore */ | |
.woocommerce table.shop_table, | |
.woocommerce table.shop_table thead, | |
.woocommerce table.shop_table tbody, | |
.woocommerce table.shop_table th, |
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
//Remove Menu Customers Option of WooCommerce | |
add_action( 'admin_menu', 'remove_menu_pages', 999 ); | |
function remove_menu_pages() { | |
remove_menu_page( 'wc-customers-list' ); | |
}; |
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
//Remove the product description tabs of WooCommerce | |
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 ); | |
function woo_remove_product_tabs( $tabs ) { | |
unset( $tabs['description'] ); // Remove the description tab | |
unset( $tabs['reviews'] ); // Remove the reviews tab | |
unset( $tabs['additional_information'] ); // Remove the additional information tab | |
return $tabs; |
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
//Remove menus and sub-menus | |
function remove_menus(){ | |
remove_menu_page( 'edit.php' ); // Posts | |
remove_menu_page( 'upload.php' ); // Media | |
remove_menu_page( 'link-manager.php' ); // Links | |
remove_menu_page( 'edit-comments.php' ); // Comments | |
remove_menu_page( 'edit.php?post_type=page' ); // Pages | |
remove_menu_page( 'plugins.php' ); // Plugins | |
remove_menu_page( 'themes.php' ); // Appearance |
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 my_theme_woocommerce_enqueue_styles( $styles ) { | |
$base_url = str_replace( array( 'http:', 'https:' ), '', get_stylesheet_directory_uri() ) . '/inc/woocommerce/css/'; | |
$styles['woocommerce-layout']['src'] = $base_url . 'woocommerce-layout.css'; | |
$styles['woocommerce-smallscreen']['src'] = $base_url . 'woocommerce-smallscreen.css'; | |
$styles['woocommerce-general']['src'] = $base_url . 'woocommerce.css'; | |
return $styles; |
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
//Remove contact form 7 menu for non-administrator users | |
if (!(current_user_can('administrator'))) { | |
function remove_wpcf7() { | |
remove_menu_page( 'wpcf7' ); | |
} | |
add_action('admin_menu', 'remove_wpcf7'); | |
} |
OlderNewer