This file contains hidden or 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 | |
/* Remove Color Picker and other unwanted user profile fields from the admin dashboard */ | |
if ( !is_admin() ) { | |
// Remove the theme color picker | |
remove_action("admin_color_scheme_picker", "admin_color_scheme_picker"); | |
// Remove and hide the rest of the User Profile fields (WP Admin Page) | |
add_action( 'personal_options', 'remove_wp_user_personal_options' ); | |
This file contains hidden or 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 | |
/* Enviar email al admin por cada registro de cliente */ | |
add_action( 'woocommerce_created_customer', 'woocommerce_created_customer_admin_notification' ); | |
function woocommerce_created_customer_admin_notification( $customer_id ) | |
{ | |
wp_send_new_user_notifications( $customer_id, 'admin' ); | |
} |
This file contains hidden or 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
/** | |
* @snippet Añadir confirmación de contraseña en el registro woocommerce | |
* @author @jose64 | |
*/ | |
//1. Verifica que la opción de generar la contraseña automáticamente no esté activada en la configuración de WooCommerce | |
function wc_register_form_password_validation() { | |
if ( get_option( 'woocommerce_registration_generate_password' ) == 'no' ) { | |
?> | |
<p class="form-row form-row-wide"> |
This file contains hidden or 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
/** | |
* @author https://stackoverflow.com/questions/21672870/woocommerce-remove-meta-boxes | |
* @author https://wp-kama.com/plugin/woocommerce/hook/woocommerce_product_data_tabs | |
*/ | |
//Eliminar metaboxes | |
function remove_metaboxes() { | |
//remove_meta_box( 'postexcerpt' , 'product' , 'normal' ); Descripcion corta | |
remove_meta_box( 'tagsdiv-product_tag' , 'product' , 'side' ); //tags | |
//remove_meta_box( 'yoast_internal_linking' , 'product' , 'side' ); //tags |
This file contains hidden or 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
/** | |
* @author https://stackoverflow.com/questions/21672870/woocommerce-remove-meta-boxes | |
* @author https://wp-kama.com/plugin/woocommerce/hook/woocommerce_product_data_tabs | |
*/ | |
//Eliminar tabs de metabox DATOS DEL PRODUCTO | |
function remove_tab($tabs){ | |
//unset($tabs['general']); | |
//unset($tabs['inventory']); |
This file contains hidden or 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
/** | |
* @snippet Añadir atributos de producto en las paginas de categorias (ocultando los atributos de variaciones fuera de stock) | |
* @author https://fsxperts.com/how-to-show-product-attributes-on-category-page/ | |
* @author https://stackoverflow.com/questions/30855309/how-to-check-product-have-variation-in-woocommerce | |
*/ | |
add_action('woocommerce_before_shop_loop_item_title','mostrar_atributos_disponibles'); | |
/* @visual_hook_guide: https://www.businessbloomer.com/woocommerce-visual-hook-guide-archiveshopcat-page/*/ | |
This file contains hidden or 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
/** | |
* @snippet Hide shipping rates when free shipping is available. | |
* @author JJMontalban | |
*/ | |
function my_hide_shipping_when_free_is_available( $rates ) { | |
$free = array(); | |
foreach ( $rates as $rate_id => $rate ) { | |
if ( 'free_shipping' === $rate->method_id ) { | |
$free[ $rate_id ] = $rate; | |
break; |
This file contains hidden or 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
/** | |
* @snippet Guarda campos de pago en el checkout aunn actualizando | |
* @author JJMontalban | |
*/ | |
function guarda_campos_pago( $posted_data ) { | |
parse_str( $posted_data, $output ); | |
WC()->session->set( 'checkout_data', $output ); | |
return $posted_data; | |
} |
This file contains hidden or 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
/** | |
* @snippet Cambia posicion el billing_phone | |
* @author JJMontalban | |
*/ | |
add_filter("woocommerce_checkout_fields", "order_fields", 150); | |
function order_fields($fields) { | |
$fields["billing"]["billing_phone"]["priority"] = 150; | |
return $fields; | |
} |