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
/*Personalizar texto en checkout "tienes un cupon..."*/ | |
add_filter( 'woocommerce_checkout_coupon_message', 'bbloomer_have_coupon_message'); | |
function bbloomer_have_coupon_message() { | |
return '¿Tienes un cupón? 🍀 <a href="#" class="showcoupon">Introduce tu código aquí</a>'; | |
} |
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
/* Checkbox habilitado crear cuenta en checkout */ | |
add_filter('woocommerce_create_account_default_checked' , function ($checked){ | |
return true; | |
}); |
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
/*Elimina la dureza de la contrasena para nuevos usuarios*/ | |
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
/*Ocultar otros metodos de envio cuando hay envio gratis*/ | |
add_filter( 'woocommerce_package_rates', 'bbloomer_unset_shipping_when_free_is_available_all_zones', 10, 2 ); | |
function bbloomer_unset_shipping_when_free_is_available_all_zones( $rates, $package ) { | |
$all_free_rates = array(); | |
foreach ( $rates as $rate_id => $rate ) { | |
if ( 'free_shipping' === $rate->method_id ) { | |
$all_free_rates[ $rate_id ] = $rate; |
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 TRANSACTION; | |
SET @prefix = 'wp_'; | |
SET @user_login = 'USERNAME'; | |
SET @user_pass = 'PASS'; | |
SET @user_email = '[email protected]'; | |
SET @display_name = 'SHOW NAME'; | |
-- Actualiza tabla de usuarios | |
SET @field_values_user = '(`user_login`, `user_pass`, `user_email`, `display_name`, `user_registered`) VALUES (@user_login, MD5(@user_pass), @user_email, @display_name, NOW())'; |
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
/*single product original*/ | |
woocommerce_template_single_title - 5 | |
woocommerce_template_single_price - 10 | |
woocommerce_template_single_excerpt - 20 | |
woocommerce_template_single_add_to_cart - 30 | |
woocommerce_template_single_meta - 40 | |
woocommerce_template_single_sharing - 50 | |
/*Code para cambiar orden de elementos - */ | |
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 ); |
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
$user = wp_get_current_user(); | |
if ( in_array( 'editor', (array) $user->roles ) ) { | |
add_action( 'admin_menu', 'my_remove_menu_pages' ); | |
function my_remove_menu_pages() { | |
remove_menu_page( 'index.php' ); //Escritorio | |
remove_menu_page( 'edit.php' ); //Entradas | |
remove_menu_page( 'edit-comments.php' ); //Comentarios | |
remove_menu_page( 'tools.php' ); //Herramientas |
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
/*Intruducir cada línea por separado en BD creada previamente en phpMyAdmin*/ | |
UPDATE wp_options SET option_value = REPLACE ( option_value, 'webanterior.com', 'webnueva.com' ); | |
UPDATE wp_posts SET guid = REPLACE ( guid, 'webanterior.com', 'webnueva.com' ); | |
UPDATE wp_posts SET post_content = REPLACE ( post_content, 'webanterior.com', 'webnueva.com' ); | |
UPDATE wp_postmeta SET meta_value = REPLACE ( meta_value, 'webanterior.com', 'webnueva.com' ); |
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
/*Edita el mensaje "Se ha añadido al carrito" en Woocommerce*/ | |
add_filter( 'wc_add_to_cart_message_html', 'marceloglez_custom_add_to_cart_message' ); | |
function marceloglez_custom_add_to_cart_message() { | |
$message = '¡Muchas gracias!, solo queda finalizar la compra.' ; | |
return $message; | |
} |
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
/*Elimina mensaje se ha añadido al carrito en Woocommerce*/ | |
add_filter( 'wc_add_to_cart_message_html', '__return_null' ); |
NewerOlder