• Resolved mybunnyb

    (@mybunnyb)


    Hello,

    Firstly, thanks for the great software and the plugin.

    I have a complex problem, or at least I may think so:

    I’ve built an ecommerce page with Elementor PRO.

    Elementor Essential Add-ons and Advanced Custom Fields (ACF) are also added.

    The site is using an API created by the site owners to dynamically update price and stock status.

    How could I use ESI for the situation not to include price and stock status to the cached pages since they are being updated in half an hour period?

    Will the cache be cleared when price and stock levels are updated if ESI is not activated?

    Essential Add-on is used for product grid/carousels and ACF is used in product template.

    Is there any other way to use ESI with Elementor?

    Cheers.

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

    (@qtwrk)

    is it a shortcode or block or something ?

    Thread Starter mybunnyb

    (@mybunnyb)

    The dynamic data is transferred from an API to 3 custom fields, WooCommerce Price and Stock fields. The 3 custom fields are to show the prices of the company’s marketplace accounts. We could call them as acf_01, acf_02 and acf_03.

    For the product template, the 3 custom fields are displayed as both shortcodes. We also have WooCommerce price and stock fields.

    For all the other pages, the prices are shown in Widgets. Widgets are by Elementor PRO and Elementor Essential Add-ons plugin. They get the data from Woo fields, which are dynamically updated by the API.

    Cheers.

    • This reply was modified 4 years, 4 months ago by mybunnyb.
    Plugin Support qtwrk

    (@qtwrk)

    have you checked this ?

    Thread Starter mybunnyb

    (@mybunnyb)

    Yeah, I did.

    It was a bit confusing for me, but I will do my best to get it 🙂

    Plugin Support qtwrk

    (@qtwrk)

    well, basically , the idea on that is , whenever you were trying to display something , you convert it into a separated request and use ESI to insert into the main page

    for example in normal way , I want to display a random number in my header , then I can do something like this

    
    <div><?php
    echo rand (1,99999);
    ?>
    </div>

    with ESI , move that PHP code into function , make it like

    <div>
    <?php
    echo apply_filters( 'litespeed_esi_url', 'my_esi_block', 'Custom ESI block' );
    ?>
    </div>

    to call the function , then code the function to display the random number , e.g.

    add_action( 'litespeed_esi_load-my_esi_block', 'my_esi_block_esi_load' );
    
    function my_esi_block_esi_load()
    {
    do_action( 'litespeed_control_set_nocache' );
    echo "Hello world".rand (1,99999);
    }
Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘ESI for dynamic content with Elementor PRO’ is closed to new replies.