• Resolved Cezar Ayran

    (@ayrancd)


    I just created a custom shop page and they want the add to cart button there…

    is there any condition (PHP) that I can use to check if store is closed don’t show the button if it is open, show it? Tks!!!

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author bizswoop

    (@bizswoop)

    For this type of use case, we’d recommend calling the store status function to determine the current store status. Based upon the store status, you can decide to show, hide or style the add to cart button that fits the store best on the custom shop page. btw. Cool visual design of the shop page for restaurants. ??

    To check if plugin is active

    defined("\Zhours\ACTIVE") && constant("\Zhours\ACTIVE")

    To get current store status
    \Zhours\get_current_status()

    I hope this helps!

    Thread Starter Cezar Ayran

    (@ayrancd)

    Hi there,

    So can I call like:

    if(\Zhours\get_current_status()){
     echo "store is open";
    }else{
    echo "store is closed"
    }

    ?

    Plugin Author bizswoop

    (@bizswoop)

    Yes correct.

    We’d recommend you first check if the plug is active using

    defined("\Zhours\ACTIVE") && constant("\Zhours\ACTIVE")

    Otherwise, if the plugin is deactivated you will get an error on the call

    Thread Starter Cezar Ayran

    (@ayrancd)

    THANKSSSSSSS A LOTTTTTT

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add condition to custom shop page’ is closed to new replies.