• Resolved Paul

    (@paulherrmann)


    Hey there,

    First of all, great plugin!
    We use this at some restaurants and there is a tablet with an interface that we use with woo api and manage all orders.

    We want to also add a button that basically closes the store, as in a “force override” and set to ordering disabled.

    However im having trouble doing this via the api or a php file. My aproach was to compare a mysql dump with and without force active yet I dont find any differences that stick out.

    Basically the idea is to run an UPDATE query and turn on force override. How can I do this? How does the force override work?

    Thanks!

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

    (@paulherrmann)

    Further research:
    The only distinct value I could find that changes is this:
    (71942, ‘zh_dbd3f_79985_993c0_30064’, ‘a:1:{i:0;s:1:\”1\”;}’, ‘yes’),
    if the force override is inactive, the value is empty.

    But injecting alone does not force close the store. Is there something else being done when you press save? Like a file created/deleted?

    Plugin Author bizswoop

    (@bizswoop)

    In our latest release today, 4.2.16. We added a hook function to help you out with this scope of custom development.

    zh_force_rewrite_status as filter for “Turn-on Force Override” setting.
    zh_force_status as filter for “Ordering Status”

    Now zh_force_rewrite_status is a part of the logic of Zhours\get_current_status()

    For example, the function

    function get_current_status() {
       ...
       // here we get the parameters which are filtered by zh_force_rewrite_status and zh_force_status
       list( $rewrite, $status ) = get_force_override_status();
       if ( $rewrite ) {
          // return force status if enabled
          return (bool) $status;
       }
       ...
    }

    Hopefully this helps aid your custom development efforts. Good luck with the project ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How does the force override work?’ is closed to new replies.