Olly

Forum Replies Created

Viewing 20 posts - 3,941 through 3,960 (of 4,446 total)
  • Author
    Posts
  • in reply to: Find out if a page is closed in template #6796
    Olly
    Admin & Mod

      still not sure exactly what you are after but let me guess a bit:

      that page you are referring to seems to be just a list of subsites (i.e blogs) rather than menu items so I am not sure how the timed menu comes into play here ?!
      or are you actually NOT using a multisite setup for this sort of thing ?
      (or maybe I am just misunderstanding things)

      in any case , thinking out loud and also writing a bit for anyone else that comes across this:

      *if* you are using a multisite setup you would probably want to do/run a
      switch_to_blog / restore_current_blog loop and within that do the following (of the top of my head, but should work). something like this:

      
      	if ( is_multisite() ) {
       	   	$blogs = $wpdb->get_results("SELECT blog_id FROM {$wpdb->blogs}", ARRAY_A);
       	   		if ($blogs) {
              	foreach($blogs as $blog) {
                 		switch_to_blog($blog['blog_id']);
      				/*get wppizza options**/
      				$options=get_option('wppizza');
      				/*check if open**/
      				$isOpen=wpizza_are_we_open($options['opening_times_standard'],$options['opening_times_custom'],$options['times_closed_standard']);
      
      				if($isOpen){
      					/*do stuff if open**/
      				}else{
      					/*do stuff if closed**/	
      				}
      				restore_current_blog();
      			}}
      	}
      
      

      (admittedly that wpizza_are_we_open function could be more user friendly , and i might just add another function that produces the same result without having to get the $options here seperately, but that’s for another day)

      however, if the story is – as i suspect – you are *NOT* using a multisite setup and you are using the timed menu to open/close your individual shops by making pages unavailable – if every page refers to a restaurant/shop (as opposed to opening times per shop), then something like the following *might* be what you are looking for

      
      /**************
      	get the timed menu options
      **************/
      $wpptmoptions=get_option('wppizza_timed_menu');
      
      /**************
      	get all the menu items on a page (before timed menu settings have been taken into consideration) 
      	returns array with the keys being the page id and the values being the menu items
      ****************/
      $wpptmMenuItemsOnPage=$wpptmoptions[items_on_pages];
      
      /**************
      	get the timed menu settings
      	returns  array with the settings you have set in the timed menu (i.e dates/times/days/pages/menuitems etc
      **************/
      $wpptmSettings=$wpptmoptions[timed_items];
      
      

      so, assuming you are just excluding whole pages (as a page would be all items for a restaurant here if i interpret things correctly)
      something like this (there are probably other ways to code this too, but as a dummy example)

      
      $wpptmCurrentTime=current_time('timestamp');/*wordpress time*/
      $shopOpen=array();
      foreach($wpptmSettings as $tm){
      	if($tm[enabled]){
      	
      	/*
      		check here if $wpptmCurrentTime is within set time date etc
      		probably want to convert the below to timestamps to compare to $wpptmCurrentTime
      		returns stuff like
      		
      		$tm[start_date] => 2014-12-02//set start date
              $tm[end_date] => 2014-12-25//set end date
              $tm[start_time] => 08:45//set start tim
              $tm[end_time] => 17:45	//set end time
      $tm[day]=>Array([1] => 1,[2] => 2) //returns array of set days 0 to 6 
      		$tm[enabled] =>1
      		
      		etc
      	*/
      	
      	if(time-date-check-passed[you'd need to write this check]]){
      		$shopOpen=array_merge($shopOpen,array_keys($tm['pages']));
      	}
      }}
      /**flip keys to be able to use isset as opposed to in_array (and also end up with unique keys)**/
      $shopOpen=array_flip($shopOpen));
      
      
      /**within your pages loop you could now do smth like**/
      if(isset($shopOpen[$pageId])){
      	/**do stuff if open**/
      }else{
      	/**do stuff if closed**/	
      }
      

      `

      in reply to: Find out if a page is closed in template #6792
      Olly
      Admin & Mod

        depends a bit on what modifications you did to your template, but something like this i would have thought
        (choose whatever action hook in the template you need )

        
        add_action('wppizza_loop_outside_end','my_custom_function',10,1);
        function my_custom_function($query){
        	if(count($query->posts)<=0){
        		
        		/**no items, do stuff**/	
        		
        	}
        /*or just use (probably better here)**/
        if($query->post_count<=0){
        		/**no items, do stuff**/
        }
        	
        }
        
        

        PS: $query is an object with all sorts of things (i.e whatever the query returns) so if ->post or ->post_count is not what you need, maybe something else will do

        in reply to: Offline Order #6764
        Olly
        Admin & Mod

          i’m probably missing something, but i don’t really get the purpose of this in the first place.
          after all, what you’d need to do is

          a) select items
          b) go to orderpage and fill in info
          c) submit order
          which does all the scripting inserting order, sending emails etc etc

          so why not use what you have (i.e the website) to do this instead of building the same thing twice ?!

          in any case, there’s no “API” or whatever it is you want to call it.
          there are filters, actions and shortcodes you can use to do things….

          in reply to: SMS and Printer Integration #6706
          Olly
          Admin & Mod

            in case any of you guys are still following this thread/topic (or anyone else for that matter that reads this)

            i am trying to develop something that at least sends an sms to a gprs printer as well as some order notifications to a phone too (either being optional)

            however, due to the fact that i haven’t got one of those printers and am no going to buy one as I personally have no need for it, it would be great if someone would be willing to be a bit of a guinea pig for testing some things (in return for a version of that plugin of course when it’s done)

            it’s early days, and probably not – initially anyway – going to be a 2 way thing (i.e receive sms, enter time , send back sms etc. as that – from what i can see – depends on proprietary hardware)

            for starters though the idea is to – at least – send any received orders to a gprs enabled printer directly plus an sms confirmation to some sms enabled phonenumber …..

            there are a few caveats but i am happy to point these out if someone is prepared to initially “lend” me a printer so to speak i can send stuff to (i.e is prepared to waste some paper) to see and check how things print out to be able to make the necessary adjustments to get going on that project

            cheers

            in reply to: Displaying category items in a grid #6705
            Olly
            Admin & Mod

              also – just bit by bit where and when i can – v2.5.11.8 now also has – within each category displayed – the following classes where appropriate

              wppizza-article-first
              wppizza-article-last

              might come in handy

              in reply to: Standard Order Display and Html E-Mail #6697
              Olly
              Admin & Mod

                i already answered this above ?!

                send me the filter you are using to dev[at]wp-pizza.com

                in reply to: Standard Order Display and Html E-Mail #6695
                Olly
                Admin & Mod

                  english only please in this forum

                  from what i gather though:
                  a)re : phpmailer: Could not instantiate mail function

                  your server is not setup to send email . you must fix this:
                  https://www.google.co.uk/#q=phpmailer:+Could+not+instantiate+mail+function

                  b)re filter:
                  your plaintext filter will add “——-“…. somewhere.
                  it’s messed up because you have not added a linebreak.
                  i.e your “——-” should be “———“.PHP_EOL;

                  in reply to: Pre-Order #6679
                  Olly
                  Admin & Mod

                    so your employees have some reading difficulties it seems ;-)

                    I can see how this would happen though. easy enough mistake to make i would think.

                    making it red or whatever is not going to work (for several reasons), but maybe some additional text like: “not today” or “future order” or something after the date if it’s not for today might work.

                    will put this on my ideas/improvements list, but can’t give you any ETA as to when this might be available at the moment

                    in reply to: Displaying category items in a grid #6641
                    Olly
                    Admin & Mod

                      for starters (just busy doing other stuff)
                      in a grid something like this (doesnt yet address name,size,img, descr but as a starter):

                      
                      article.wppizza-article{
                      	width:33%;
                      	border:1px solid #999999;
                      	float:left;
                      	clear:none;
                      	margin:0;
                      	margin-bottom:0;
                      }
                      article.wppizza-article:nth-child(3n) {
                          background: blue;
                          clear:left;
                      }
                      
                      

                      probably have to play around with this and perhaps some last child element selectors to clear after the last etc….
                      all pure css though

                      in reply to: Prices not displaying #6631
                      Olly
                      Admin & Mod

                        no problem, at least we got to the root cause

                        must admit though I am not going to investigate why that plugin does what it does.
                        having said that , there are plenty of other plugins that enable shortcodes in other places

                        in reply to: Prices not displaying #6628
                        Olly
                        Admin & Mod

                          >I imagine therein lies the issue
                          yup
                          essentially there are no prices applied/existent to a menu item . however, there certainly should be and i can see them in the admin , so it’s kind of strange

                          somehow this looks like the meta data gets reset on display.

                          could you disable other plugins , and see if this changes things ?

                          in reply to: Prices not displaying #6626
                          Olly
                          Admin & Mod

                            thanks.
                            can’t see anything really wrong there.
                            could you enable debug and see if you get any errors there ?

                            https://support.wp-pizza.com/topic/how-to-enable-debug-in-wordpress/

                            in reply to: Prices not displaying #6624
                            Olly
                            Admin & Mod

                              i would need admin access (either setting your reply private here, or sending the un/pw directly to [email protected]).
                              can’t tell from the frontend

                              in reply to: get the list of all the sizes #6606
                              Olly
                              Admin & Mod

                                you do know what arrays are, right ?
                                have a look at the array and you will see the bits it’s made up of and print what you need to print …

                                in reply to: get the list of all the sizes #6604
                                Olly
                                Admin & Mod

                                  >..the output is: ArrayArray

                                  well, yeah , of course it is. it’s up to you what you want to do with it

                                  >i think much better solusion would be to do like this …
                                  no. it just isn’t…
                                  the “better” solution is not entering prices you do not want displayed in the first places

                                  in reply to: Error when trying to order #6597
                                  Olly
                                  Admin & Mod

                                    sounds like your server has problems sending emails

                                    try setting
                                    wppizza->settings->Select Type of Mail Delivery to HTML/Plaintext (as that tends to give better error messages)

                                    and see what it says (and let me know)

                                    also enable debug. the debug.log might also help
                                    https://support.wp-pizza.com/topic/how-to-enable-debug-in-wordpress/

                                    in reply to: Had an email fail on a paypal payment. #6593
                                    Olly
                                    Admin & Mod

                                      also make sure you read the troubleshooting here :

                                      https://support.wp-pizza.com/paypal-gateway-extension/

                                      in reply to: get the list of all the sizes #6576
                                      Olly
                                      Admin & Mod

                                        >i dont want to show near evry price the size
                                        use css: .wppizza-article-price-lbl{display:none}

                                        >i want to print all the sizes in the top of the table.
                                        use (one of the) action hooks in the templates (i.e wppizza_loop_outside_start for example – hava a look at the loop templates. $options[sizes] will return all the sizes)

                                        >some of the items don’t have the extra big size:
                                        then you should probably create another size with just “small”,”medium”,”big” and use that one for items that have no “extra big”

                                        in reply to: separate Discounts for self-pickup and delivery #6561
                                        Olly
                                        Admin & Mod

                                          i see what you mean.
                                          essentially you are applying 2 discounts , one general one if order >25 on all orders, plus another one of 10% on pickup

                                          although this makes sense to me (as in why should the customer not get both discounts when both requirements apply) , i might put an option into the coupon/discounts plugin to specify if a discount should only apply on delivery …i’ll have to mull this over for a bit how to best do that (without breaking things)

                                          in reply to: separate Discounts for self-pickup and delivery #6560
                                          Olly
                                          Admin & Mod

                                            ok, i’ll check tomorrow and see if i can reproduce this

                                          Viewing 20 posts - 3,941 through 3,960 (of 4,446 total)