Change Return to Shop Button - Empty Cart Screen Woocommerce

Hi,

I had fixed this a while ago adding code to my Functions.php file but since update it has dissapeared and I cant even save edits in my Functions file… so idk

I need my return to shop button be a custom link not the automatic shop page by woocommerce.

I cant find this anywhere… its doing my head in…

Please can you help!

Hey William,

It sounds like you’ve made modifications to the parent theme’s functions.php. Please note that the parent theme could be updated and it will wipe out all the changes you’ve made to the parent theme when that happens. Regretfully, the only solution in this case is to restore from a working backup of your site. You might need to contact your web host if they have kept a backup of your site and if they can restore your site for you.

It’s strongly recommended to use a child theme if you plan on making modifications to the parent theme. This way, all your changes will not get deleted if there’s an update to the parent theme.

Regarding changing the shop button, if you’re referring to the breadcrumbs, you can follow the guide in modifying the breadcrumbs in this thread.

Here’s an example code should be added in the child theme’s functions.php.

function my_custom_breadcrumbs( $crumbs, $args ) {

  foreach ( $crumbs as $i => $crumb ) {
    if ( $crumb['label'] === 'Shop' && is_singular('product')) {
      $crumbs[$i]['url'] = 'http://example.com/page/';
    }
  }

  return $crumbs;

}


add_filter( 'x_breadcrumbs_data', 'my_custom_breadcrumbs', 10, 2 );

If that’s not what you mean, please provide the URL of the page with the shop button and also a screenshot of the actual shop button.

Please also note that we can only guide or point you to the right direction. Custom coding is not a part of our product support so it would be best that you consult with a third party developer to implement and improve our guide.

Thanks.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.