Skip to content

Instantly share code, notes, and snippets.

@yuliyang
Created October 18, 2021 03:35
Show Gist options
  • Save yuliyang/38d82eca91808ede8aca158c78b4987a to your computer and use it in GitHub Desktop.
Save yuliyang/38d82eca91808ede8aca158c78b4987a to your computer and use it in GitHub Desktop.
[WooCommerce] Add Continue Shopping
<?php
// Add continue shopping
// add_action( 'woocommerce_before_checkout_form', 'ching_back_to_store' );
add_action('woocommerce_cart_coupon', 'ching_back_to_store');
// add_action( 'woocommerce_cart_actions', 'ching_back_to_store' );
function ching_back_to_store() { ?>
<a class="button wc-backward" href="<?php echo esc_url( wc_get_page_permalink( 'shop' ) ); ?>"> <?php _e( '繼續購物', 'woocommerce' ) ?> </a>
<?php
}
add_action( 'woocommerce_thankyou', 'ching_order_received', 10, 1 );
function ching_order_received() { ?>
<a class="button wc-backward" href="<?php echo esc_url( wc_get_page_permalink( 'shop' ) ); ?>"> <?php _e( '繼續購物', 'woocommerce' ) ?> </a>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment