Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello @yhazem ,

    Unfortunately, I could not locate a specific way to change this order received URL structure.

    I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    If you need a paid solution, you can consider taking help from one of our partner’s website.

    Thank you ??

    Thread Starter yhazem

    (@yhazem)

    Ok thank you for your help anyways

    Thread Starter yhazem

    (@yhazem)

    Hello so I found an answer to the problem just add this piece of snippet

    add_action(
       'woocommerce_new_order',
       static function ( int $order_id, WC_Order $order ) : void {
          $new_order_key = str_replace( 'wc_', 'cp_', $order->get_order_key() );
          $order->set_order_key( $new_order_key );
          $order->save();
       },
       5,
       2
    );
    add_filter(
    	'woocommerce_new_order_data',
    	static function ( array $new_order_data ) : array {
    		$new_order_data['post_password'] = str_replace( 'wc_', 'cp_', $new_order_data['post_password'] );
    		return $new_order_data;
    	}
    );

    and change cp to what you want

    • This reply was modified 3 years, 12 months ago by yhazem.
    • This reply was modified 3 years, 12 months ago by yhazem.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to change wc_order from url’ is closed to new replies.