• Resolved maxdamage101

    (@maxdamage101)


    Hello

    So I’m using a payment plugin, this requires my order id. But it only finds my standard order_id that woocommerce creates, is there a way to let my plugin know how to only use Custom orderid? Because my ordernumbers only have numbers, but they have random 10 numbers.

    So long story short, I need a custom filter that lets me change the order_id to my custom order id

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support kenil802

    (@kenil802)

    Hi @maxdamage101,

    Can you please try the given filter and check whether you are able to change the order_id to the custom order_id or not.

    Filter: alg_wc_custom_order_numbers

    Please let us know how it goes.

    Regards,
    Kenil Shah

    Hello I’m facing the same issue, i think this is quite important.
    For example, my clients get an email from paypal/bank whenever a payment is received, the order id on the email says the original wordress order id not the new one, so its quite difficult for them to check which is which.

    I have bought the pluging because i had to make some customizations without thinkin that these issues would occour.
    I have opened a ticket in the helpdesk.

    I was thinking, maybe at least we could send this new order id as a comment to the payment service so at least it would appear in the email.
    For example i found how to add a custom comment to paypal, we could return instead the new order number instead of the order id;
    i have not tested this code yet though.

    add_filter( 'ae_pppf_custom_parameter', 'own_ae_pppf_custom_parameter', 10, 2);
    function own_ae_pppf_custom_parameter($customer_note , $order) {
    //return $order->get_order_number();
        return get_post_meta($order->get_order_number(), '_alg_wc_custom_order_number', true);
    }

    We can hopefully workout this issue.

    Plugin Support kenil802

    (@kenil802)

    Hi @ildaniel8,

    Thank you for sharing the code.

    I will pass your query to my developer and I will get back to with an update on this on your ticket which you have created.

    Regards,
    Kenil Shah

    Thread Starter maxdamage101

    (@maxdamage101)

    The thing is I’m using a BTCPAY plugin payment processor, when I activate your custom ordernumer plugin. Then it takes the custom ordernumbers, but it’s not finding the order_id(well post_id I geuss?)

    Now they told me that I need to use this snippet and change it to my needs

    function get_order_id_from_custom_order_style($orderid){
      if(is_string($orderid)){
        $result = preg_replace('~\D~', '', $orderid);
        return $result;
      }
      return $orderid;
    }
    add_filter('woocommerce_order_id_from_number', 'get_order_id_from_custom_order_style', 1);

    But it’s not working for me, it’s only finding the custom order numbers, and I don’t need the custom order number for it to work. I need the ordernumber that it gives you before your plugin is activated.

    Created a ticket here also on their page| https://github.com/btcpayserver/woocommerce-plugin/issues/45

    • This reply was modified 4 years, 7 months ago by maxdamage101.
    Plugin Support kenil802

    (@kenil802)

    Hi @maxdamage101,

    Regarding the query, our plugin does not change the order id of the order. So, you can get the order with the Woocommerce functions.

    Please let us know if you have any further queries.

    Regards,
    Kenil Shah

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘need help letting my payment plugin find custom order_id’ is closed to new replies.