Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter nikwitting

    (@nikwitting)

    Problem solved.
    After some time i found the term “deeplinking lightbox” to be useful in my search. Most deeplinking lightboxes allows you to acces the open lightbox with a link but still the back button did either go to far back or did not close the lightbox at all. I then found this useful site comparing lightboxes, with a demo for each:
    https://justifiedgrid.com/lightboxes/
    I tested them all and found the PhotoSwipe lightbox to be the only one with the right functionality such that the back button actually closes the lightbox as intended while staying in the same page.

    From WordPress i then added the plugin named “Lightbox with PhotoSwipe”
    And to allow it to work on the woocommerce product images I disabled the standard lightbox by adding the following to functions.php:

    add_action( 'wp', 'tu_disable_wc_lightbox', 20 );
    function tu_disable_wc_lightbox() {
        remove_theme_support( 'wc-product-gallery-lightbox' );
    }

    Quite surprises that I only found this single plugin among many with this quite basic but effective functionality.

    Thread Starter nikwitting

    (@nikwitting)

    Thank you for your response.

    I do link to the regular product itself. The problem is that most of my users then from the regular product page click on the image to enlarge it. After spending some time looking at the image maybe 50% click on the back button. Then they are moved all the way back to Facebook instead of just back to the regular product page.

    So what I would like is for the backbutton instead to just go back to the regular page.

    I agree with regards to changing the behaviour.

    So a solution that in someway instead of opening the lightbox in the same URL open it at with eg. an empty parameter:

    website.com/product?=

    Should allow the backbutton to go back to website.com/product while still allowing the usual lighbox closing options.

    • This reply was modified 5 years, 11 months ago by nikwitting.
Viewing 2 replies - 1 through 2 (of 2 total)