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@WEB.COM'; | |
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' ); |
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
/*OPCIÓN 1: Primero activar checkbox "Redirigir a la página del carrito tras añadir productos con éxito"*/ | |
function cod_redirect_checkout_add_cart( $url ) { | |
$url = wc_get_page_permalink( 'checkout' ); | |
return $url; | |
} | |
add_filter( 'woocommerce_add_to_cart_redirect', 'cod_redirect_checkout_add_cart' ); | |
/*OPCIÓN 2*/ | |
/* Enviar directamente al pago */ |
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
// NUEVO SHORTCODE PARA REGISTRO: [wc_reg_form_bbloomer] | |
add_shortcode( 'wc_reg_form_bbloomer', 'bbloomer_separate_registration_form' ); | |
function bbloomer_separate_registration_form() { | |
if ( is_admin() ) return; | |
if ( is_user_logged_in() ) return; | |
ob_start(); | |
// NOTE: THE FOLLOWING <FORM></FORM> IS COPIED FROM woocommerce\templates\myaccount\form-login.php |
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
/* Enviar directamente al pago */ | |
add_filter ('add_to_cart_redirect', 'redirect_to_checkout'); | |
function redirect_to_checkout() { | |
global $woocommerce; | |
$checkout_url = $woocommerce->cart->get_checkout_url(); | |
return $checkout_url; | |
} |
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
/*Aviso bajo imagen en pdto único*/ | |
add_action( 'woocommerce_after_single_product_summary' , 'bbloomer_add_below_prod_gallery', 5 ); | |
function bbloomer_add_below_prod_gallery() { | |
echo '<div class="woocommerce-product-gallery" style="background: #51559f; padding: 1em 2em; color: #ffffff;">'; | |
echo '<span>Todas las descargas equivalen a 1 crédito, <b><a href="https://pruebas.marceloglez.com">elije tu plan</a>.</span></b>'; | |
echo '</div>'; | |
} |