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
/** | |
* @snippet Minimum Order Amount | |
* @author JJMontalban | |
*/ | |
//woocommerce_check_cart_items will give the customer an warning when reaching the checkout unless purchase requirement is met. | |
add_action( 'woocommerce_check_cart_items', 'jj_minimum_order_amount' ); | |
add_action( 'woocommerce_before_cart', 'jj_minimum_order_amount' ); | |
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
/** | |
* @snippet Poner a noindex las paginas con 404 | |
* @author JJMontalban | |
*/ | |
function add_noindex_nofollow_404() { | |
if ( is_404() ) { | |
echo '<meta name="robots" content="noindex, nofollow" />'; | |
} | |
} | |
add_action( 'wp_head', 'add_noindex_nofollow_404' ); |
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
/** | |
* @snippet Elimina campos del checkout de woocommerce | |
* @author JJMontalban | |
*/ | |
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' ); | |
function custom_override_checkout_fields( $fields ) { | |
unset($fields['billing']['billing_company']); | |
unset($fields['billing']['billing_address_1']); |
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
/** | |
* @snippet oculta secciones de mi-cuenta de woocommerce | |
* @author JJMontalban | |
*/ | |
add_filter( 'woocommerce_account_menu_items', 'hideSectionProfile', 999 ); | |
function hideSectionProfile( $items ) { | |
unset($items['downloads']); | |
unset($items['dashboard']); | |
return $items; |
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
/** | |
* @snippet Añadir texto antes del checkout billing form | |
* @author JJMontalban | |
*/ | |
add_action( 'woocommerce_before_checkout_shipping_form', 'titulo_datos_envio', 11 ); | |
function titulo_datos_envio() { | |
wc_print_notice( '<h3>¿Quién recibirá el pedido?</h3>' ); | |
} |
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
/** | |
* @snippet Elimina la obligatoriedad de password fuerte | |
* @author JJMontalban | |
*/ | |
add_action ('wp_print_scripts', function () { | |
if (wp_script_is ('wc-password-strength-meter', 'enqueued')) | |
wp_dequeue_script ('wc-password-strength-meter'); | |
}, 100); |
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
/** | |
* @snippet Dividir texto categorias de productos entre arriba y abajo. Editable desde el admin | |
* @author JJMontalban | |
*/ | |
/** | |
* @snippet 2 categories description | |
*/ | |
add_action( 'product_cat_add_form_fields', 'dl_wc_anadir_editor_1', 10, 2 ); |
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
/** | |
* @snippet Quitar estilos de bloques en los widgets | |
* @author JJMontalban | |
*/ | |
function quitar_estilos_bloques_woo() { | |
wp_deregister_style( 'wc-blocks-style' ); | |
wp_dequeue_style( 'wc-blocks-style' ); | |
} | |
add_action( 'enqueue_block_assets', 'quitar_estilos_bloques_woo' ); |
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
/** | |
* @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; | |
} |