• Resolved mirkonik

    (@mirkonik)


    Hello,

    I do have a situation, where I want to replace or intercept the automatic generation of the custom order numbers.

    Problem description:
    Beside our normal WooCommerce orders coming from our eCommerce website, we also import orders from another platform. Those other orders are basically handled like all orders (with some additional information) and get the custom order numbers <== and this is what I like to prevent, because in that case, I want to set the order number coming from the external plugin.

    Is it somehow possible to replace or skip the generation of the custom order number? Maybe there is some sort of hook I can use to make some conditions in which case the custom order number should be applied.

    Thanks for the great plugin,

    Mirko

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author tychesoftwares

    (@tychesoftwares)

    Hi Mirko,

    Do you want that the custom order number shouldn’t be generated? There should be WooCommerce Order ID on WooCommerce Order Page? Or do you want that when you import the order, WooCommerce Order ID should be imported instead of custom order ID? Would you give me one example of the requirement you are asking for? It will help to understand clearly.

    Thread Starter mirkonik

    (@mirkonik)

    In my case, the best possible solution would be to first determine, where the order is coming from (FrontPage shop, manual backend order, API generated order).

    For my situation, I would simply skip the number generated by Custom Order Numbers for WooCommerce and use the one that is coming from the API call made by the external system.

    Plugin Author tychesoftwares

    (@tychesoftwares)

    Thank you @mirkonik for sharing your solution here. This would be helpful to others.

    Ask me if you have any further questions.

    Thread Starter mirkonik

    (@mirkonik)

    I simply added a filter to ‘woocommerce_order_number’ which basically makes a query to the Database to filter out the individual orders that are generated by the external system. Thereafter I update the _alg_wc_custom_order_number and _alg_wc_custom_order_number and assign ne order number given by the external system.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Replace Order Number generated by Custom Order Numbers’ is closed to new replies.