I want to change the remove coupon link in the cart. At the moment it’s the word Remove in brackets: [Remove]
.
I found the function wc_cart_totals_coupon_html
in the cart-totals.php
template.
And I also found the link inside that function.
$coupon_html = $discount_amount_html . ' <a href="' . esc_url( add_query_arg( 'remove_coupon', rawurlencode( $coupon->get_code() ), defined( 'WOOCOMMERCE_CHECKOUT' ) ? wc_get_checkout_url() : wc_get_cart_url() ) ) . '" class="woocommerce-remove-coupon" data-coupon="' . esc_attr( $coupon->get_code() ) . '">' . __( '[Remove]', 'woocommerce' ) . '</a>';
I just don’t know how to change that link part.
It would be really great if the link would appear in the table cell with the label (wc_cart_totals_coupon_label( $coupon );
) instead the cell with the discount amount. But for now it would really help if I could change the link in a first step.
2
Answers
Try with static url link as per your need.
Create code as per the WooCommerce standard.
wc-cart-functions.php
contains on line 295So to change the link you can use
To change the table cell in cart you can edit the
cart/cart-totals.php
file on line 35-38