Hi there,
the Mini Cart and the Add to Cart buttons all use core Woocommerce functions.
Depending on what changes you want to make you can probably use Hooks in Woocommerce to change the output.
For example you can unhook the woocommerce_widget_shopping_cart_button_view_cart and hook in your own custom button:
add_action( 'woocommerce_widget_shopping_cart_buttons', function(){
// Remove default cart button
remove_action( 'woocommerce_widget_shopping_cart_buttons', 'woocommerce_widget_shopping_cart_button_view_cart', 10 );
// Add custom cart callback
add_action( 'woocommerce_widget_shopping_cart_buttons', 'my_custom_widget_shopping_cart_button_view_cart', 10 );
}, 1 );
// Custom cart callback
function my_custom_widget_shopping_cart_button_view_cart() {
// Do your custom cart stuff here
// Example for reference:
// $original_link = wc_get_cart_url();
// $custom_link = home_url( '/cart/?id=1' ); // HERE replacing cart link
// echo '<a href="' . esc_url( $custom_link ) . '" class="button wc-forward">' . esc_html__( 'View custom cart', 'woocommerce' ) . '</a>';
}
For the Add to cart button you could use the woocommerce_loop_add_to_cart_link filter:
https://github.com/woocommerce/woocommerce/blob/b19500728b4b292562afb65eb3a0c0f50d5859de/templates/loop/add-to-cart.php#L25