Olly

Forum Replies Created

Viewing 20 posts - 1,281 through 1,300 (of 4,446 total)
  • Author
    Posts
  • in reply to: Add Ingredients Issue #36697
    Olly
    Admin & Mod

      if you are talking about the images there’s an option in wppiza->layout->Menu Item Images “pretty photo”
      which will open an image in a lightbox kind of thing , other than that , there might be some other plugins that do things like that , but i have no idea

      in reply to: Add Ingredients Issue #36695
      Olly
      Admin & Mod

        Hi
        sorry about the late reply. git completely snowed under with other things and it got lost in the queue so to speak

        first of all, as I believe I already mentioned (perhaps), that plugin is in serious need of updating (in fact more or less re-writing) as soon as I get a chance , so what i would suggest – as a starting point – is to make a copy of the function
        prepare_ingredients_for_markup($post_id, $item, $type) you will find in wppizza-addingredients.php to wherever you need it as – for example myprefix_prepare_ingredients_for_markup($post_id, $item), omitting the type parameter

        then at the top of that function add
        $ai_options = get_option('wppizza_addingredients'); and replace the occurrences of $this->pluginOptions with $ai_options (or whatever you have called it) and pass the $post_id, $item from your loop to that new function you created

        furthermore, i would also then perhaps replace
        $showByGroup= (!empty($this->pluginOptions['options']['ingredients_show_groups_in_email']) && $type != 'cart' ) ? true : false;/* to do, by emails / thank you etc only */

        with a simple
        $showByGroup = true; or $showByGroup = false; (depending on what output you want) and take it from there

        Note: none of the above is tested and it’s just an idea here, but should work i would think and should give you some more manageable array you can then use as you see fit

        hope that helps somewhat

        in reply to: Warning epaydk payment error #36602
        Olly
        Admin & Mod

          ahh, now that makes sense , because it means that the notification message (at ipn.php) gets sent multiple times back to the server as otherwise you would not ever receive the normal order confirmation email
          (this seems to happen only sometimes from what i can see and for reasons only ebay would be able to track down. might be waiting for a timely server response or any other reason, i don’t know)

          in a nutshell, the order execution goes like this (there are a few other steps , but to keep it simple)

          notification received at ipn, look for an order that has status “inprogress” or “unconfirmed” for that id.
          if found, execute order, sending emails etc. once that’s all happened set status to “completed” – done

          if the same ipn gets sent again, it will be looking for that “inprogress” status , however, it does not exist anymore as it is now “completed” (as we do not want to execute that order multiple times of course)

          that’s as an explanation and it’s the only way i can see this happening

          as there is a possibility somewhat, that other gateways might do the same, i will add something to the plugin (that’s the main wppizza plugin) to account for this. As I am in the middle of tearing a number of things apart an update is quite a few days away yet, so in the meantime, you could edit a corefile as follows (assuming you are familiar with simple php editing)

          in wp-content/plugins/wppizza/classes/class.wppizza.order_execute.php you will find at approx line 1166

          
          	/* error details */
          	$result['error'][] = array(
          		'critical'=> $critical, /* force sending of email to admin */
          		'error_id'=> 30007,
          		'error_message' => __('order not found using order id','wppizza-admin'),
          		'wp_error' => ''
          	);
          	/* logging, and sending */
          	$this->gateway_logging($result['error'], $gateway_reply, $order_id, $this->wppizza_gateway_ident, 'get-prepared-error');
          
          	/*
          	ipn, just return false !
          	*/
          	return false;
          

          edit this to be the following

          
          	/* 
          	if we receive ipn notifications multiple times for the same order, the status will already have changed to completed, 
          	so before throwing errors, check if that is the case and if so , simply ignore
          	*/
          	$order = WPPIZZA()->db->fetch_order_details(false, $order_id, false, array('COMPLETED'), $wp_user_id);
          	if(!empty($order)){return;}
          
          	/* error details */
          	$result['error'][] = array(
          		'critical'=> $critical, /* force sending of email to admin */
          		'error_id'=> 30007,
          		'error_message' => __('order not found using order id','wppizza-admin'),
          		'wp_error' => ''
          	);
          	/* logging, and sending */
          	$this->gateway_logging($result['error'], $gateway_reply, $order_id, $this->wppizza_gateway_ident, 'get-prepared-error');
          
          	/*
          	ipn, just return false !
          	*/
          	return false;
          

          save (and make a test order i would suggest)

          i’ll add something like that to the next update

          if you still have issues once this is added, please let me know.
          while making sure that this works, maybe you could also perhaps enable
          “Log successful orders” /wp-admin/edit.php?post_type=wppizza&page=settings for a few days
          as it might give us a better idea/clue in case the above does not rectify the issue

          (if it all works , after letting things run for a while, you can turn this off again)

          in reply to: Warning epaydk payment error #36597
          Olly
          Admin & Mod
            This reply has been marked as private.
            in reply to: Add Ingredients Issue #36596
            Olly
            Admin & Mod

              just did a test on your site and it works just fine…?!
              any particular items in cart or checkout details you can give me so i can reproduce this ?

              in reply to: Warning epaydk payment error #36595
              Olly
              Admin & Mod
                This reply has been marked as private.
                in reply to: Warning epaydk payment error #36592
                Olly
                Admin & Mod
                  This reply has been marked as private.
                  in reply to: Add Ingredients Issue #36579
                  Olly
                  Admin & Mod

                    re: On a side issue

                    as i dont know where or how you are using it , i cannot really comment other then to say that generally speaking you have to loop through $item[‘extend’][‘addingredients’]

                    correction: i believe this is actually $item['extend_data']['addingredients']

                    in reply to: Add Ingredients Issue #36578
                    Olly
                    Admin & Mod

                      got a link ?

                      in reply to: How to get list of orders with php ? #36577
                      Olly
                      Admin & Mod

                        in fact i would suggest you simply use your own query

                        ie. something like

                        
                        global $wpdb;
                        $orders = $wpdb->get_results( "SELECT * FROM ".$wpdb->prefix . WPPIZZA_TABLE_ORDERS." WHERE payment_status='COMPLETED'  ORDER BY order_date DESC");

                        as opposed to relying on internal functions that might change or get removed at any time (unless they are documented here https://docs.wp-pizza.com/developers/?section=filters-actions-functions , hence why there are a bunch of wrappers available the list of which gets expanded on an as needed basis )

                        in reply to: How to get list of orders with php ? #36575
                        Olly
                        Admin & Mod

                          that’s just offensive
                          feel free to write your own plugin, maintain it over the years keeping things backwards compatible for old php, mysql versions while also accounting for endless variations of server setup, adding forever new things for your 1000’s of users , reply to literally thousands of support requests / emails / forum topics and then come back to me complaining

                          in any event , that get_orders_orderhistory is a leftover from v2 and is only used in the order history and will probably be removed at some point in favour of a wrapper that will then use the fetch_order_details which will then allow queries that are not as restrictive as they are at the moment with the output being formatted as opposed to just the raw data and a bunch of other options

                          in reply to: How to get list of orders with php ? #36570
                          Olly
                          Admin & Mod

                            i’m afraid , there isnt really a simple way to do this as virtually all queries will only ever return a restricted dataset
                            (either by user id , or by order id , or limited by pagination etc etc)

                            that said, i can see the usefulness of making this available in some circumstances , and will add an easy to use wrapper function in one of the next updates

                            in reply to: Restrict by Street Address #36443
                            Olly
                            Admin & Mod
                              in reply to: Restrict by Street Address #36430
                              Olly
                              Admin & Mod

                                PS: why is there a wp_footer action that prints some js if you are also enqueuing a customjs anyway you could add this to instead ?
                                surely , one of these is not required i would have thought
                                just an observation

                                in reply to: Restrict by Street Address #36429
                                Olly
                                Admin & Mod

                                  >I’m getting an error

                                  of course you do. your syntax is wrong (it even tells you where the issue is)
                                  https://www.w3schools.com/jsref/jsref_regexp_test.asp

                                  in reply to: Restrict by Street Address #36413
                                  Olly
                                  Admin & Mod

                                    am also a bit puzzled as to why an address should match John|Smith|David|Luke
                                    furthermore, the == NOTE == part here
                                    https://support.wp-pizza.com/downloads/wppizza-delivery-by-postcode/
                                    *might* already be sufficient in what you want to do (but i cannot know the exact requirements of course)

                                    in reply to: Restrict by Street Address #36412
                                    Olly
                                    Admin & Mod

                                      it’s not a plugin (well, it is kind of , but it’s inbuilt so to speak)
                                      it’s simply a way to add a custom validation rule you will then have available in the validation dropdown in wppizza->order form settings for whatever field you want to apply this to
                                      i.e

                                      
                                      	//to add your own rule - let's say 'my_rule'
                                      	add_filter('wppizza_filter_validation_rules','my_function');
                                      	function my_function($validation_rules){
                                      		$validation_rules['my_rule']= array( 'lbl'=> 'My Rule', 'parameters'=>false, 'callback'=>false, 'enabled'=>true);
                                      	return $validation_rules;
                                      	}
                                      

                                      will add a “My Rule” to the dropdown

                                      
                                      	$.validator.methods.my_rule = function (value, element) {
                                         		return this.optional(element) || /^(?:\d+|\d{1,3}(?:[\s\.,]\d{3})+)(?:[\.,]\d+)?$/.test(value);
                                      	}
                                      

                                      is the javascript that validates the field that has “My Rule” as validation selected (i.e it should return true or false depending on how you want to validate this)

                                      and if the concept of filters/actions s new to you:
                                      https://docs.wp-pizza.com/developers/?section=filters-actions-functions

                                      in reply to: Restrict by Street Address #36392
                                      Olly
                                      Admin & Mod

                                        i would suggest you create validation rules like mentioned here
                                        https://docs.wp-pizza.com/developers/?section=additional-validation-function

                                        in reply to: There is no information about selected checkboxes #36340
                                        Olly
                                        Admin & Mod

                                          the order history shows the information that was sent in the email to the shop (i.e the info in the email to the shop == info in order history )

                                          in reply to: There is no information about selected checkboxes #36339
                                          Olly
                                          Admin & Mod

                                            did you enable that checkbox (whatever you named it ) to be used in the templates ?

                                          Viewing 20 posts - 1,281 through 1,300 (of 4,446 total)