更改网址woocommerce"返回商店"

时间:2017-12-13 09:26:43

标签: php wordpress woocommerce

出于某种原因,当我回到商店时,我得到了这个:

无法访问此网站

xn--%20%20%20-zyhgadab9cq9cg1a6brlgdd9aqmj4akrf8l9b8c’s server DNS address could not be found.
Try:
Checking the connection
Checking the proxy, firewall, and DNS configuration
Running Windows Network Diagnostics
ERR_NAME_NOT_RESOLVED

我想更改网址以返回商店页面:https://vemavm.com/test/shop/

以下是我的在线资料:

<p class="return-to-shop">
    <a class="button wc-backward" href="<?php echo esc_url( apply_filters( 'woocommerce_return_to_shop_redirect', wc_get_page_permalink ('shop') ) ); ?>"><?php _e( 'Return to shop', 'xclean' ) ?></a>
</p>

2 个答案:

答案 0 :(得分:0)

试试此代码

function your_theme_prefix_continue_shopping_redirect_url($url) {
$url = 'https://www.google.co.in/'; // Add your custom link here
return $url;
}
add_filter('woocommerce_return_to_shop_redirect', 'your_theme_prefix_continue_shopping_redirect_url');

根据需要更改网址值。

答案 1 :(得分:0)

没有火箭科学,只需在function.php中添加此功能

 // cart page return to shop link
  add_filter( 'woocommerce_return_to_shop_redirect', 'tm_get_shop_link' );
  // continue shopping redirect
  add_filter( 'woocommerce_continue_shopping_redirect', 'tm_get_shop_link' );
  function tm_get_shop_link() {
    return get_site_url();
  } // end function