• Resolved andybedoy1

    (@andybedoy1)


    Hello,

    [I use your plugin to change the order number in woocomerce.
    Once I have made the desired prefix and number to display. I found that when searching in the woocomerce option to track an order, it does not work with this number. Tracking can only be done with the real generated woocomerce order number.

    Is it possible to fix this, because the client gets the number my site generated with your plugin and I can’t actually track it?]

    Thank you in advance!
    Anderson

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author WebToffee

    (@webtoffee)

    Hi @andybedoy1,

    You can look up orders with the order number modified using this plugin from the Woocommerce orders page search box.

    Please see the demonstration screen recording here.

    Thread Starter andybedoy1

    (@andybedoy1)

    Hi Team,

    That function is ok always work, I talk about the front page /track-my-order/

    Thread Starter andybedoy1

    (@andybedoy1)

    The Client put his order number and his email and doesn’t show the tracking

    Plugin Author WebToffee

    (@webtoffee)

    Hi @andybedoy1,

    You are using some plugin to have a tracking code search facility in your site and it is that plugin’s job to find the order numbers correctly. They should search using get_order_number() instead of get_id(). It is better if you can contact your tracking plugin support team to fix it. If they can provide any filters to modify it we can help out as well.

    Hello,

    I have been struggling with this problem for a long time and we have discussed it with you.
    You’ve told me this before, but it’s not really like that.

    This is the functionality of woocomerce – woocommerce_order_tracking shortcode

    There is no way to get woocomerce to rewrite this part. Please help by attaching code to use in the function part to allow this .. or some other option.

    I enclose what I received as feedback on this from my theme developers:

    It is not a special copy of the plugin. And WPBakery doesn’t have any special code for this. You can follow the WooCommerce documentation and create the order tracking form using their shortcode. Also, check how it works with a default WordPress theme without the WPBakery page builder.

    As well as we did a test only with woocommerce_order_tracking shortcode and it really is so. You can test it yourself.
    Thanks for your understanding and cooperation.
    Please for your help ??
    Paul

    • This reply was modified 4 years, 2 months ago by sdeal.
    Plugin Author WebToffee

    (@webtoffee)

    Hi @sdeal,

    Since the Woocommerce order tracking form doesn’t support the sequential order numbers, you may please use the below code snippet to add support to it. Copy the code to your active child theme’s functions.php

    add_filter( 'woocommerce_shortcode_order_tracking_order_id', 'woocommerce_shortcode_order_tracking_order_id', 10, 1 );
    function woocommerce_shortcode_order_tracking_order_id( $order_id ) {
    	$args	 = array(
    		'post_type'		 => 'shop_order',
    		'post_status'	 => 'any',
    		'meta_query'	 => array(
    			array(
    				'key'		 => '_order_number',
    				'value'		 => $order_id,
    				'compare'	 => '=',
    			)
    		)
    	);
    	$query	 = new WP_Query( $args );
    	if ( !empty( $query->posts ) ) {
    		$order_id = $query->posts[ 0 ]->ID;
    	}
    	return $order_id;
    }

    Hope it helps.

    Thanks a lot for your cooperation, you mention child theme’s and whether it works correctly if I put it in the main theme because I don’t use child theme’s

    Again Thank you a lot ??

    I did a test but it still doesn’t work – when I use the main code generated by woocomerce there is no problem.
    If it would help, I can provide data access?

    Thank you in advance!

    Hello, webtoffee,

    can you help – this will be useful for many of your customers and users of this plugin?
    Please and thank you in advance!
    Pavel

    Plugin Author WebToffee

    (@webtoffee)

    Hi @sdeal,

    We have analyzed the code again and noticed that if the modified order number has a prefix or suffix other than a number, the filter is not working. The reason is that the woocommerce filter is using different trim functions to sanitize the input.

    It will work if you are just using a sequential order number without custom any prefix or suffix. Since the filter is provided by woocommerce, this is out of our hands.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Tracking Page is not working’ is closed to new replies.