Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Oscar-Abad-Folgueira/3a70f3bfd2fdb97ccf8c723409ac424d to your computer and use it in GitHub Desktop.
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
<?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