Created
April 12, 2021 07:54
-
-
Save Oscar-Abad-Folgueira/3a70f3bfd2fdb97ccf8c723409ac424d to your computer and use it in GitHub Desktop.
WooCommerce Snippet: Añadir botón "Seguir comprando" tras añadir productos al carrito
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 | |
/** | |
* @snippet WooCommerce Snippet: Añadir botón "Seguir comprando" tras añadir productos al carrito | |
* @author Oscar Abad Folgueira | |
* @author_url https://www.oscarabadfolgueira.com | |
* @snippet_url https://www.oscarabadfolgueira.com/anadir-el-boton-de-seguir-comprando-tras-anadir-productos-al-carrito-en-woocommerce | |
*/ | |
add_filter( 'wc_add_to_cart_message_html', 'anadir_boton_seguir_comprando_anadir_carrito', 10, 2); | |
function anadir_boton_seguir_comprando_anadir_carrito( $message, $products ){ | |
$message .= sprintf( '<br/><a href="%s" class="button wc-forward" style="clear:both;margin-top:5px;">%s</a>', esc_url( wc_get_page_permalink( 'shop' ) ), esc_html__( 'Seguir comprando', 'woocommerce' ) ); | |
return $message; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment