Woocommerce Continue Shopping button on single product pages

Hi,

I’ve been trying to get a Continue Shopping button (or Return To Shop) on my single product pages. I managed to find a youtube video showing some code of where and how to make a Continue Shopping link on my cart page and that seems to be working well enough. Although, I couldn’t stylize it very much, (it was supposed to be a button but became only an underlined link), but it’s good enough and most importantly, it works!

So how do I do the same and hopefully less complicated and more stylized button/link on my single product pages?

For the cart, I added the code to the Child functions.php page. And also, for some reason, I can’t make the changes directly on WordPress since the X upgrade. Now I have to make the changes on my CPanel for it to work.

The website is http://lauracrisci.com

I’ve included the admin login info so you can take a look around.

Also, much less important, but I’d like to clean it up anyway, is that I added the “Woo Out Of Stock Products” plugin and it works well enough, but the overlay image somehow tiles and repeats in the box below the image that has the name and price of the product. Is there a way I can get it to stop doing it and/or resize it?

Thanks in advance for all the wonderful help you have and continue to provide,

Laura :slight_smile:

Hello @LauraCrisci,

Thanks for asking. :slight_smile:

  • To change the Continue Shopping button style, please add following CSS under X > Theme Options > CSS:
.woocommerce-message .button {
    color: #00ad02;
    border: 1px solid #ea79d2;
    background-color: #f7f7f7;
    border-width: 3px;
    text-transform: uppercase;
    background-color: transparent;
    border-radius: 0.25em;
    padding: 0.429em 1.143em 0.643em;
    font-size: 14px;
}

.woocommerce-message .button:hover {
    border: 1px solid #00ad02;
    border-width: 3px;
    text-transform: uppercase;
    background-color: transparent;
    border-radius: 0.25em;
    padding: 0.429em 1.143em 0.643em;
    font-size: 14px;
}
  • The login details you have shared is not working and I am getting error message (please see secure note). Kindly confirm the login details. That being said, please make sure that you have correct file permissions to edit the code in WordPress theme code editor. Please take a look at following article for some help.
  • I can’t see the duplicate issue on the website. Can you please share the exact URL?However, please note that over here issue revolves around use of 3rd party plugins and issues coming because of 3rd party plugins falls outside the scope of support we offer.

Above changes are done using custom CSS. If you would like to explore CSS, please take a look at following resource:

https://www.w3schools.com/css/

Please note that providing support for custom codes (like CSS changes) falls outside the scope of support we can offer. In case of any issues with the layout because of custom codes we won’t be able to provide support.

Thanks.

Hi,

Thanks for the CSS. I could swear that I tried that and it wasn’t working! But now it is… username and password that I gave you is working now too! Must be a poltergeist or something :slight_smile:

Anyway, the thing is that I want to put that same “Continue Shopping” button on the single product pages because otherwise, they go to look at a product and there is no obvious button to get them back to the shopping page… just like it was in the cart page before I added the Continue Shopping button. It was set up through the Child function.php page. I’m hoping the same can be done for the Single Product pages.

All I really need is the same thing (the Return To Cart button) that is on the empty cart page which you should find here as long as you don’t put anything in the cart first http://lauracrisci.com/cart .

So how do I put that same thing into the functions.php for the Single Product pages to have the option to either “Continue Shopping” or “Return To Cart”…doesn’t really matter what it says as long as it does the job.

I hope that makes more sense…

Thank you for the quick response!

Laura.

Hello @LauraCrisci,

Thanks for asking. :slight_smile:

Thanks for the credentials and yes it’s working. I tried editing the code in WordPress theme code editor and it’s working and saving fine. So, there is no need for you to access CPanel to edit code.

To display Continue Shopping button on single product page, please use the solution mentioned in following thread. I have tested the code in my local setup and it works fine.

Thanks.

Thanks for the code, it worked like a charm!

As far as the WP theme code editor goes, I don’t know how you’re doing it because it still won’t let me. I can put the code in, but when I go to save it, it takes a long time and then tells me I can’t do it that way and need to do it some other way. I don’t recall the exact words, but that was the gist of it. Did you actually manage to add code to the child functions.php and save it?

It’s not that important because it’s just as easy to do it through the cpanel, but thought you might want to know about it.

Thanks again, you guys rock!!

Laura :slight_smile:

Hello Laura,

Thanks for updating the thread.

Yes, you are right. PHP editor is not saving and it’s showing Unable to communicate back with site to check for fatal errors, so the PHP change was reverted. You will need to upload your PHP file change by some other means, such as by using SFTP. error message after long wait. I tried to activate Parent theme to see if there’s any issues with child theme customization but issue is still there. If I recall correctly, last time I tested editor was working fine. However, this time I am getting the error message and changes are not getting saved.

I also did Google search and WordPress users have faced the same issue. And most of them have reported plugin conflict as the cause of problem. In that regards, can you please test for plugin conflict by deactivating all plugin and then edit the PHP code under Appearance > Editor (CSS editor is working fine and changes are saving) and see if changes are getting saved or not. If changes you made are indeed getting saved then plugin is causing the problem. Next, step would be to reactivate one plugin at a time to narrow down.

You can learn more about the same problem in following posts:

http://theusualstuff.com/wordpress-4-9-error-edit-files-resolved/
https://wpengine.com/support/php-editor-errors-wordpress-4-9-higher/

Thanks.

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