Home Forums WoodMart support forum Add back to previous page

Add back to previous page

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #561201

    nax1to
    Participant

    Hello, is it possible to add a button or an arrow at the top of the products to go back to the previous page?

    Attachments:
    You must be logged in to view attached files.
    #561273

    Hello,

    Sorry there is no direct option in theme settings available for that. But you can add a back button in the mobile header.

    Navigate to WoodMart > Header Builder > Edit Current Header > Switch to Mobile Header > Add the Text/ HTML elements and paste the following code:
    https://ibb.co/k5nMzM2

    <button id="hdr_bck_btn" onClick="window.history.back()"><i class="fas fa-chevron-left"></i></button>

    Then, Please try using the below Custom CSS code and paste it to Dashboard >> Theme Settings >> Custom CSS >> Custom CSS for mobile section:

    #hdr_bck_btn {
        color: #7f2f2f !important;
        background-color: #396539;
    }

    Best Regards.

    #561447

    nax1to
    Participant

    It works like a charm by adding the following code in the functions.php file of the child theme:

    
    add_action( 'woocommerce_before_single_product', 'back_button', 5 );
    function back_button() {
    global $product;
    echo ' <a href="history.go(-1)"> Go Back</a> '; 
    }
    
    • This reply was modified 1 week, 1 day ago by nax1to.
    • This reply was modified 1 week, 1 day ago by nax1to.
    • This reply was modified 1 week, 1 day ago by nax1to.
    #561582

    Hello,

    You are Most Welcome.

    We are glad that you managed to solve the problem yourself. You are Great!!!

    Let us know if there’s anything else we can do for you! You can always reach us at any time. We are always here to help you.

    Have a wonderful day.

    Topic Closed.
    Best Regards.

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Add back to previous page’ is closed to new replies.