Improved compatibiltiy with plugins that modify the order number
-
There are a few plugins that modify the order number (e.g. by adding a prefix or by making the numbers sequential). Currently, the “WooCommerce Payment Gateway for Saferpay” plugin does not take that modification into account and instead uses the order id directly from the order object leading to two different IDs being displayed to the customer. The fix is simple: $order->id can be replaced by $order->get_order_number() in the following two lines:
$description = str_replace("#_ORDERID", $order->id, $gateway->order_description); $orderid = $gateway->order_id_prefix . $order->id;
so they look like this:
$description = str_replace("#_ORDERID", $order->get_order_number(), $gateway->order_description); $orderid = $gateway->order_id_prefix . $order->get_order_number();
If no such plugin is used, the get_order_number() method returns the exact same result as order->id, so backwards compatibility is not broken.
Unfortunately I didn’t find a git repository to contribute to, so I’m using this forum to contribute the patch.
https://www.ads-software.com/plugins/woocommerce-payment-gateway-for-saferpay/
- The topic ‘Improved compatibiltiy with plugins that modify the order number’ is closed to new replies.