• Resolved oliversaar

    (@oliversaar)


    Hi, I have a problem showing the current informations from the API.

    API is connected fine and in the admin area via “Show retrieved data” it shows me the correct informations.

    I added [open_text]%now%[/open_text] at the end and it shows the current time.

    I tried [open p update=”immediate”] but it destroys the layout and the result is the same.

    I use the DIVI builder.

    This is the returned code:

    {
        "html_attributions": [],
        "result": {
            "business_status": "OPERATIONAL",
            "name": "Gastroenterologie \u00b7 Urologie - Dr. Volker Brand \u00b7 Dr. Kora Brand - Facharztzentrum M\u00fcnchen Martinsried",
            "obfuscated_type": [],
            "opening_hours": {
                "open_now": true,
                "periods": [
                    {
                        "close": {
                            "day": 1,
                            "time": "1700"
                        },
                        "open": {
                            "day": 1,
                            "time": "0800"
                        }
                    },
                    {
                        "close": {
                            "day": 2,
                            "time": "1800"
                        },
                        "open": {
                            "day": 2,
                            "time": "0800"
                        }
                    },
                    {
                        "close": {
                            "day": 3,
                            "time": "1700"
                        },
                        "open": {
                            "day": 3,
                            "time": "0800"
                        }
                    },
                    {
                        "close": {
                            "day": 4,
                            "time": "1500"
                        },
                        "open": {
                            "day": 4,
                            "time": "0800"
                        }
                    },
                    {
                        "close": {
                            "day": 5,
                            "time": "1300"
                        },
                        "open": {
                            "day": 5,
                            "time": "0800"
                        }
                    }
                ],
                "weekday_text": [
                    "Monday: 8:00 AM \u2013 5:00 PM",
                    "Tuesday: 8:00 AM \u2013 6:00 PM",
                    "Wednesday: 8:00 AM \u2013 5:00 PM",
                    "Thursday: 8:00 AM \u2013 3:00 PM",
                    "Friday: 8:00 AM \u2013 1:00 PM",
                    "Saturday: Closed",
                    "Sunday: Closed"
                ]
            },
            "url": "https://maps.google.com/?cid=12685796617698384571"
        },
        "status": "OK"
    }

    Any ideas?

    The page I need help with: [log in to see the link]

Viewing 6 replies - 16 through 21 (of 21 total)
  • Plugin Author Design Extreme

    (@designextreme)

    @oliversaar May I suggest just using one [open_text] here? You can encompass the multiple <span> tags and there just needs to be one single check/refresh of data rather than 3.

    Something that I haven’t tested extensively is multiple instances of the update/immediate shortcodes. I’ll keep a copy of the code you’ve used here to test and add new functionality if needed. It’s good to have some examples of usage where it may work in a way that was not intended.

    Thread Starter oliversaar

    (@oliversaar)

    Okaaay, I didn’t know that I can do that ??
    Now it’s:

    <div class="openinginfo">
      <div class="op-is-open-shortcode">
        [open_text update="immediate"]
          [open_now]
          <span class="op-open">Gerade ge?ffnet</span>
          [/open_now]
          [closed_now]
          <span class="op-closed">Gerade geschlossen</span>
          [/closed_now]
          <span class="op-next-period op-next-period">
          %if_open_now%
          	Wir schlie?en um %today_end% Uhr.
          %end%
          %if_closed_now%        
          	%if_open_tomorrow% Wir ?ffnen morgen um %tomorrow_start% Uhr. %end%
            %if_closed_tomorrow% Wir ?ffnen in %hours% Stunden wieder. %end%
        	%end%
         [/open_text]
        </span>
      </div>
    </div>

    Tomorrow morning I will see if this works.

    Thanks very much for looking into it!

    Thread Starter oliversaar

    (@oliversaar)

    Unfortunately this code does not update in a cached page. I had to disable the cache to see the results. Maybe the update=”immediate” just does not work in [open_text]?

    Plugin Author Design Extreme

    (@designextreme)

    @oliversaar I have checked the page you mentioned previously and it does check the opening hours information immediately on page load. Is the cache currently disabled?

    As I said before, I haven’t preformed extensive testing for multiple instances of the [open update="immediate"] (and with other Shortcodes).

    Let me know the current state of things and I’ll figure out what is wrong and what I can do to resolve it either in the code and/or for you now?

    Perhaps check on the support link and contact me through WhatsApp as it may be easier to coordinate things a little more easily this way.

    Plugin Author Design Extreme

    (@designextreme)

    @oliversaar I’ve just had a look at the Test page and I believe it is cached (to my first request) – so I can see that data is only collected for the first instance.

    Please can you move the:

    [open_text update="immediate"]%now%[/open_text]

    …to the first position (1 of 3) and then duplicate this shortcode below so there’s one after the other?

    Plugin Author Design Extreme

    (@designextreme)

    @oliversaar I have updated the plugin to support the update parameter in the [open_text] Shortcode. It did not support Ajax calls before version 1.23. Now all the Shortcodes accept this parameter (as detailed in the Shortcode tab).

Viewing 6 replies - 16 through 21 (of 21 total)
  • The topic ‘View does not update’ is closed to new replies.