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
/* | |
* INCLUIR PESTAÑA PERSONALIZADA EN LA FICHA DE PRODUCTO | |
*/ | |
function woo_custom_product_tab( $tabs ) { | |
$tabs['custom_tab'] = array( | |
'title' => 'TITULO', // Sustituir TITULO por el nombre de la pestaña, | |
'priority' => 50, // Modificar el orden de la pestaña | |
'callback' => 'woo_new_product_tab_content' | |
); | |
return $tabs; |
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
/* | |
* INSTRUCCIONES DE PAGO PERSONALIZADAS EN WOOCOMMERCE | |
*/ | |
function woo_order_email_instructions( $order, $sent_to_admin ) { | |
if ( ! $sent_to_admin ) { | |
if ( 'bacs' == $order->payment_method ) { // Sustituir bacs por ID de pasarela de pago: cod, bacs, paypal, stripe, cheque, etc. | |
echo '<p><strong>Instruciones:</strong> Indique el nº de pedido en el concepto de la transferencia para agilizar las gestiones de envío.</p>'; | |
} | |
} | |
} |
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
/* | |
* REDIRECCIÓN DEL CHECKOUT A PÁGINA DE AGRADECIMIENTO PERSONALIZADA | |
*/ | |
function woo_redirect_to_custom_thank_you( $order_id ){ | |
$order = new WC_Order( $order_id ); | |
$url = 'URL'; // Cambiar por la URL personalizada | |
if ( $order->status != 'failed' ) { | |
wp_redirect($url); | |
exit; | |
} |
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
/* | |
* REDIRECCIÓN DEL CHECKOUT SIN PASAR POR CARRITO | |
*/ | |
function woo_redirect_to_checkout() { | |
global $woocommerce; | |
$checkout_url = $woocommerce->cart->get_checkout_url(); | |
return $checkout_url; | |
} | |
add_filter ('woocommerce_add_to_cart_redirect', 'woo_redirect_to_checkout'); |
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
<?php global $post; if($post->ID == 'SUSTITUIR POR EL ID DEL POST ORIGINAL'){ ?> | |
<!-- SUSTITUIR POR EL CÓDIGO DE EXPERIMENTO DE GOOGLE ANALYTICS --> | |
<?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
<!-- Google Analytics --> | |
<script> | |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | |
})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); | |
ga('create', 'UA-XXXXXXXX-X', 'auto'); | |
ga('require', 'displayfeatures'); | |
<?php if (is_singular('post')) { ?> |
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
<?php if (is_singular('post')) { ?> | |
ga('set', 'dimensionX', '<?php echo get_the_author_meta('display_name', $author_id); ?>'); | |
<?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
/* | |
* DESHABILITAR CAMPOS DEL CHECKOUT DE WOOCOMMERCE | |
*/ | |
function woo_custom_checkout_fields( $fields ) { | |
unset ($fields['billing']['billing_first_name']); // Eliminar el campo Nombre | |
unset ($fields['billing']['billing_last_name']); // Eliminar el campo Apellidos | |
unset ($fields['billing']['billing_company']); // Eliminar el campo Empresa | |
unset ($fields['billing']['billing_address_1']); // Eliminar el campo Dirección 1 | |
unset ($fields['billing']['billing_address_2']); // Eliminar el campo Dirección 2 | |
unset ($fields['billing']['billing_postcode']); // Eliminar el campo Código Postal |
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
<meta content="TIPO TWITTER CARD" name="twitter:card"/> <!-- Especifica el tipo de Twitter Card a utilizar --> | |
<meta content="@USUARIOTWITTER" name="twitter:site"/> <!-- Especifica el usuario de Twitter --> | |
<b:if cond="data:blog.url == data:blog.homepageUrl"> | |
<meta content="URL IMAGEN SITIO WEB" name="twitter:image"/> <!-- Especifica URL de imagen para el sitio web --> | |
<meta expr:content="data:blog.metaDescription" name="twitter:description"/> | |
<meta expr:content="data:blog.pageTitle" name="twitter:title"/> | |
<meta expr:content="data:blog.url" name="twitter:url"/> | |
<b:else/> | |
<title><data:blog.pageName/> | <data:blog.title/></title> | |
<meta expr:content="data:blog.postImageThumbnailUrl" name="twitter:image"/> |
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
<meta name="twitter:card" content="TIPO TWITTER CARD" /> <!-- Especifica el tipo de Twitter Card a utilizar --> | |
<meta name="twitter:site" content="@USUARIOTWITTER" /> <!-- Especifica el usuario de Twitter --> | |
<?php if ( is_category() ) { $cat = get_query_var('cat'); $metacat= strip_tags(category_description($cat)); $current_page_URL = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; ?> | |
<meta name="twitter:url" content="<?php echo esc_url($current_page_URL);?>" /> | |
<meta name="twitter:title" content="<?php single_cat_title();?>" /> | |
<meta name="twitter:description" content="<?php echo $metacat;?>" /> | |
<?php } ?><?php if (is_single() || is_page() ) : if (have_posts() ) : while (have_posts() ) : the_post(); ?> | |
<meta name="twitter:description" content="<?php echo get_the_excerpt(); ?>" /> | |
<meta name="twitter:url" content="<?php the_permalink(); ?>" /> | |
<meta name="twitter:title" content="<?php the_title(); ?>" /> |