Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Fahad Mahmood

    (@fahadmahmood)

    Can you please specify the line number and the php file? I need to add an extra check if that plugin installed and activated so this meta should be added else we should ignore.

    Thread Starter kranate

    (@kranate)

    i added it on line 480:

    			update_post_meta( $order_id, '_customer_user_agent', get_post_meta($this->original_order_id, '_customer_user_agent', true) );
    			
    			//webmasting - Teilnehmer
    			update_post_meta( $order_id, '_tribe_tickets_meta', get_post_meta($this->original_order_id, '_tribe_tickets_meta', true) );				
    		}
    		
    		/**
    		 * Duplicate Order Billing meta
    Plugin Author Fahad Mahmood

    (@fahadmahmood)

    Thank you, in fact i am working on this feature so whatever will be in parent order, can be copied down to child orders. And we can select these meta keys from settings page.

    Plugin Author Fahad Mahmood

    (@fahadmahmood)

    Please keep using your custom code for now, i am in testing phase for this feature. Hopefully i will release another version with confirmation of this message in changelog.

    Thread Starter kranate

    (@kranate)

    Hi Fahad,

    maybe you missed this ticket because you changed to status to resolved.
    but there is still no message in the last changelogs about this.
    are you working on a solution?

    Plugin Author Fahad Mahmood

    (@fahadmahmood)

    Please check the recent changelog, in fact when i fix something either release or don’t, i consider it resolved. So a new version is released, although a few more things are still incomplete as i am getting more feature requests so it takes time.

    Thread Starter kranate

    (@kranate)

    now I could see your message in the changelog for version 2.3.2.
    but your update doesn’t work for me.

    it only works like this:
    => in “Duplicate Order Header meta” section
    => with $_tribe_tickets_meta = get_post_meta($order_id, '_tribe_tickets_meta', true);

    		/**
    		 * Duplicate Order Header meta
    		 */
    		
    		public function clone_order_header($order_id, $_order_total=false){
    			
    			
    			//pree($_order_total);
    			if($_order_total){
    				
    			}else{
    				
    				$_order_total = get_post_meta($this->original_order_id, '_order_total', true);
    				
    			}
    			
    			//pree($_order_total);exit;
    	
    			update_post_meta( $order_id, '_order_shipping', get_post_meta($this->original_order_id, '_order_shipping', true) );
    			update_post_meta( $order_id, '_order_discount', get_post_meta($this->original_order_id, '_order_discount', true) );
    			update_post_meta( $order_id, '_cart_discount', get_post_meta($this->original_order_id, '_cart_discount', true) );
    			update_post_meta( $order_id, '_order_tax', get_post_meta($this->original_order_id, '_order_tax', true) );
    			update_post_meta( $order_id, '_order_shipping_tax', get_post_meta($this->original_order_id, '_order_shipping_tax', true) );
    			update_post_meta( $order_id, '_order_total',  sanitize_wcos_data($_order_total));
    	
    			update_post_meta( $order_id, '_order_key', 'wc_' . apply_filters('woocommerce_generate_order_key', uniqid('order_') ) );
    			update_post_meta( $order_id, '_customer_user', get_post_meta($this->original_order_id, '_customer_user', true) );
    			update_post_meta( $order_id, '_order_currency', get_post_meta($this->original_order_id, '_order_currency', true) );
    			update_post_meta( $order_id, '_prices_include_tax', get_post_meta($this->original_order_id, '_prices_include_tax', true) );
    			update_post_meta( $order_id, '_customer_ip_address', get_post_meta($this->original_order_id, '_customer_ip_address', true) );
    			update_post_meta( $order_id, '_customer_user_agent', get_post_meta($this->original_order_id, '_customer_user_agent', true) );
    			
    			if($order_id){
    					$_customer_user_agent = get_post_meta($originalorderid, '_customer_user_agent', true);
    					$_tribe_tickets_meta = get_post_meta($order_id, '_tribe_tickets_meta', true);
    					
    					if($_customer_user_agent)
    					update_post_meta( $order_id, '_customer_user_agent',  $_customer_user_agent);
    					
    					if($_tribe_tickets_meta)
    					update_post_meta( $order_id, '_tribe_tickets_meta', get_post_meta($this->original_order_id, '_tribe_tickets_meta', true) );
    				}				
    																																  
    		}
    		
    		/**
    		 * Duplicate Order Billing meta
    		 */
    
    Thread Starter kranate

    (@kranate)

    is there really a reason why you can’t add without any condition like this:

    
    		/**
    		 * Duplicate Order Header meta
    		 */
    		
    		public function clone_order_header($order_id, $_order_total=false){
    			
    			
    			//pree($_order_total);
    			if($_order_total){
    				
    			}else{
    				
    				$_order_total = get_post_meta($this->original_order_id, '_order_total', true);
    				
    			}
    			
    			//pree($_order_total);exit;
    	
    			update_post_meta( $order_id, '_order_shipping', get_post_meta($this->original_order_id, '_order_shipping', true) );
    			update_post_meta( $order_id, '_order_discount', get_post_meta($this->original_order_id, '_order_discount', true) );
    			update_post_meta( $order_id, '_cart_discount', get_post_meta($this->original_order_id, '_cart_discount', true) );
    			update_post_meta( $order_id, '_order_tax', get_post_meta($this->original_order_id, '_order_tax', true) );
    			update_post_meta( $order_id, '_order_shipping_tax', get_post_meta($this->original_order_id, '_order_shipping_tax', true) );
    			update_post_meta( $order_id, '_order_total',  sanitize_wcos_data($_order_total));
    	
    			update_post_meta( $order_id, '_order_key', 'wc_' . apply_filters('woocommerce_generate_order_key', uniqid('order_') ) );
    			update_post_meta( $order_id, '_customer_user', get_post_meta($this->original_order_id, '_customer_user', true) );
    			update_post_meta( $order_id, '_order_currency', get_post_meta($this->original_order_id, '_order_currency', true) );
    			update_post_meta( $order_id, '_prices_include_tax', get_post_meta($this->original_order_id, '_prices_include_tax', true) );
    			update_post_meta( $order_id, '_customer_ip_address', get_post_meta($this->original_order_id, '_customer_ip_address', true) );
    			update_post_meta( $order_id, '_customer_user_agent', get_post_meta($this->original_order_id, '_customer_user_agent', true) );
    			
    							
    			update_post_meta( $order_id, '_tribe_tickets_meta', get_post_meta($this->original_order_id, '_tribe_tickets_meta', true) );				
    		}
    		
    		/**
    		 * Duplicate Order Billing meta
    		 */
    
    Plugin Author Fahad Mahmood

    (@fahadmahmood)

    In next version, i am doing in the correction function. If you notice, the function you are using to update this meta, is different. Condition is always good because everybody won’t be using the tribe plugin. Thank you.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘please add ticket meta’ is closed to new replies.