• Resolved JamieLe

    (@jamieleemi)


    Hi, our site uses multi-currency and some other geolocation tricks, so I have all the WC product buying parts of the template inside an ESI block.

    Everything work in terms of geolocation and currency data not being cached, but when I try to add a product to the cart, I get this error:?Please choose product options by visiting {product name}.

    When I disable ESI, the problem goes away but then things get cached that aren’t supposed to.

    Do you think this is because of a script or something that’s being suppressed or disabled by the cache?

    I’ve read that other caches can do this to variable products.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support qtwrk

    (@qtwrk)

    from surface , it looks like when you add cart, it doesn’t know what product to add ? how did you create the ESI block ?

    Thread Starter JamieLe

    (@jamieleemi)

    Hi, please watch this short video that I just sent to one of our developers:

    https://youtu.be/D2EocqYJ36k

    Plugin Support qtwrk

    (@qtwrk)

    from what I see on the video , I think it’s kind of like , the widget needs something like post id or product id , but when you convert it to ESI, this ID is lost , so it doesn’t know what product to add

    please try suggest your dev to update a bit of code , e.g.

    $post_id = url_to_postid( $_SERVER[ 'ESI_REFERER' ] );

    use this inside of widget when it is within ESI subrequest, it will get the post id based on parent page URL

    Thread Starter JamieLe

    (@jamieleemi)

    Hi, our developer says this didn’t help.

    Did you watch my video, above, that shows how we set it up?

    Is there anyway you could implement something that allows us to wrap cache-excluded elements with a CSS class or ID?

    Or an implementation that works with WPBakery to exclude container rows?

    Thread Starter JamieLe

    (@jamieleemi)

    Or can you make a fix via a plugin update?

    Plugin Support qtwrk

    (@qtwrk)

    unfortunately no , ESI is complicated , you can not use simply use a css class or element id , it requires a backend code to work with , please check this example :

    https://docs.litespeedtech.com/lscache/lscwp/api/#generate-esi-block-url

    https://github.com/qtwrk/lscwp-esi-pv/blob/main/esi-post-view.php

    Thread Starter JamieLe

    (@jamieleemi)

    Okay, fair enough, but it’s not working the way we’ve implemented it. Is there a way you could help us fix it? Or make it compatible with WP bakery so we can block parent rows from the cache?

    Plugin Support qtwrk

    (@qtwrk)

    well, I can try , but I don’t think it will work that way

    please create a ticket by mail to support at litespeedtech.com with reference link to this topic.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘ESI causing error: Please choose product options by visiting’ is closed to new replies.