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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 ocultar desglose de impuestos en los emails | |
* @author https://stackoverflow.com/questions/64767532/remove-formatted-displayed-tax-from-order-total-line-on-woocommerce-emails | |
*/ | |
add_filter( 'woocommerce_get_formatted_order_total', 'change_emails_formatted_order_total', 10, 2 ); | |
function change_emails_formatted_order_total( $formatted_total, $order ) { | |
// Remove from order total the formatted taxes displayed on emails notifications only | |
return is_wc_endpoint_url() ? $formatted_total : wc_price( $order->get_total(), array( 'currency' => $order->get_currency() ) ); | |
} |
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/*/ | |