WC Rest Api create order not creating suborder for WCMP Vendor

Theme and Plugin Support

WC Rest Api create order not creating suborder for WCMP Vendor Open

Viewing 10 reply threads
  • Author
    Posts
    • #78904
      Alan Bird
      Participant

      I am connecting to WC through the WC API to “Create Order” for a product linked to a vendor, but this does create the sub-order automatically for the vendor account and therefore not showing on the vendor dashboard.

      Please see the “create order” call below. Are there any WCMP meta that should be added to facilitate the flow in this call to create the suborder for the vendor?

      {
      “payment_method”: “peach-payments”,
      “payment_method_title”: “Credit Card”,
      “billing”: {
      “first_name”: “John”,
      “last_name”: “Doe”,
      “address_1”: “969 Market”,
      “address_2”: “”,
      “city”: “San Francisco”,
      “state”: “CA”,
      “postcode”: “94103”,
      “country”: “US”,
      “email”: “john.doe@example.com”,
      “phone”: “(555) 555-5555”
      },
      “shipping”: {
      “first_name”: “John”,
      “last_name”: “Doe”,
      “address_1”: “969 Market”,
      “address_2”: “”,
      “city”: “San Francisco”,
      “state”: “CA”,
      “postcode”: “94103”,
      “country”: “US”
      },
      “line_items”: [
      {
      “product_id”: 1935,
      “quantity”: 1,
      }
      ],
      }

    • #79094

      Hi @Alan Bird, our team is looking into this.

      Kindly provide us sometime. I will keep you posted.

    • #83353
      hakang
      Participant

      I have the same problem. I can not create an order with the vendor key and values. The order is successfully created with Rest-api and I can see the order in the woocommerce orders in admin but I can see two separate orders are created. In the Postman; They are completely two different orders with different order_keys. The parent_id s are not attached. The meta_data does not have the Vendor information. So how can we attach the vendor to the order when its created. Update the meta will be a workaround in this case. There is no connection between the two newly created orders. I couldn’t figure it out how to trigger this.

    • #83457
      hakang
      Participant

      I ended up doing something like this. It’s really not the proper way but I am able to do what I want. I have a checkout.ts file. I create the order in app and get the order it from rest api then send the order id to the server. I assume you can create the order in php. my logic was created that way… Then in my php file I added these lines

      $new_vendor_order = new WCMp_Order();
      $new_vendor_order->wcmp_create_orders($order_id, $posted_data, $order, $backend = false) ;

      They were already in class-wc-stripe-customer.php. It needs some arguments but I am sure you will figure it out. Someone with same problem can explain this better than me but for now I guess its a starting point. The $posted_data there is amount, currency, description but you’ll figure it out.
      public function create_customer( $args = array() )

      In my Postman I am able to see The orders are connected to each other. one order key is empty but from this point it will be easy to tie it to the vendor.
      [
      {
      “id”: 18148,
      “parent_id”: 18147,
      ……

      {
      “id”: 18147,
      “parent_id”: 0,

    • #83934

      @hakang, our team is checking this.

      Kindly provide them sometime.

    • #84520

      @Alan Bird, @hakang, You can track the progress of this issue here – https://github.com/wcmarketplace/dc-woocommerce-multi-vendor/issues/176

      • #84656
        hakang
        Participant

        Thx. Moumita.

    • #85082
      hakang
      Participant

      I have tried commit 127073f and couldn’t make it work. Any suggestions?

    • #85166
      susmita
      Moderator

      @Hakang,

      Kindly check the codes on how to commit an issue in github.

      For further help, you may follow this link – https://help.github.com/en/github/managing-files-in-a-repository/adding-a-file-to-a-repository-using-the-command-line

    • #85757
      hakang
      Participant

      What do you mean? I didn’t want to commit an issue in github. Please clarify.

    • #85762

      @Hakang, sorry for the misunderstanding, we presumed you tried to commit the fix from your end also.

      We have already added the commit, our lead developer is checking this.

      Once everything will be okay, he will commit the code.

    • #86413

      @Alan Bird, @hakang, We have added the fix in our last git update: https://github.com/wcmarketplace/dc-woocommerce-multi-vendor/issues/152

      So, after downloading the plugin from here – https://github.com/wcmarketplace/dc-woocommerce-multi-vendor/archive/master.zip, follow these steps :

      – Delete the installed WC Marketplace via wp-admin >> plugin
      – Unzip the GitHub plugin
      – Rename the folder as “dc-woocommerce-multi-vendor” and remove the master tag. Now, zip this folder again.
      – Install this plugin on your site.

      We will release the same in our next update also.

Viewing 10 reply threads

Please LOGIN to reply to this topic

WCMp bundle is available at a slashed price

Grab It Now