Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order shipping address not visible in wordpress admin panel #527

Closed
topheroes opened this issue Jul 14, 2021 · 6 comments · Fixed by #752
Closed

Order shipping address not visible in wordpress admin panel #527

topheroes opened this issue Jul 14, 2021 · 6 comments · Fixed by #752
Labels
bug Something isn't working needs researched
Milestone

Comments

@topheroes
Copy link

When I log in


mutation LoginUser {
  login( input: {
    clientMutationId: "1214",
    username: "user@email.com",
    password: "nenado"
  } ) {
    authToken
    user {
      id
      name
    }
  }
}

Then add to card

mutation cartAdd{
  addToCart(input: { productId: 332, quantity: 2, clientMutationId: "1215" }){
    
    cartItem {
      quantity
      subtotal
      subtotalTax
      tax
      total
      key
    }
  }
}

Then checkout

mutation checkout{
    checkout( input:{clientMutationId:"1216",isPaid:false, shipping:{address2:"дом колотушкина", address1: "Улица Пушкина", email:"user@email.com", firstName:"Уася", lastName:"Пупкин", postcode:"244", state:"st", company:"dod", phone:"12892121", city:"hehe", country:RU}, paymentMethod:"cod"} ) {
        clientMutationId
         
    }
}

The order appears in wordpress admin Woocommerce Orders page, but it doesn't have the shipping address.
Please advise.

@kidunot89
Copy link
Member

kidunot89 commented Aug 11, 2021

@topheroes I think you forgot the shipToDifferentAddress flag. Try this.

mutation CheckoutMutation{
    checkout(
      input:{
        clientMutationId: "1216",
        isPaid: false, 
        shipping: { 
          address2:"дом колотушкина", 
          address1: "Улица Пушкина", 
          email:"user@email.com", 
          firstName:"Уася", 
          lastName:"Пупкин", 
          postcode:"244", 
          state:"st", 
          company:"dod", 
          phone:"12892121", 
          city:"hehe", 
          country:RU
        }, 
        shipToDifferentAddress: true, 
        paymentMethod: "cod"
      } 
    ) {
      clientMutationId
      ...
    }
}

@topheroes
Copy link
Author

@kidunot89

shipToDifferentAddress makes no difference, there is no shipping address shown in wordpress backend.

@kidunot89 kidunot89 added the bug Something isn't working label Aug 21, 2021
@kidunot89 kidunot89 added this to the v0.10.4 milestone Aug 21, 2021
@kidunot89 kidunot89 removed this from the v0.10.4 milestone Sep 8, 2021
@kidunot89 kidunot89 added this to the v0.11.0 milestone Feb 2, 2022
@JamieBradders
Copy link

Hey, I'm experiencing this issue too. Is there a suggested workaround to make this visible until the 0.11.0 milestone has been met? Thank you, P.S. I really appreciate the work that goes into the plugin 🙏

@JamieBradders
Copy link

Hey @topheroes I just noticed that I was experiencing this problem because a Shipping Zone was not set on my instance of WooCommerce 🤦. It might be worth checking your instance too, incase it is missing a shipping zone?

Once I activated the shipping zone, I could see the shipping address appearing in the WooCommerce Admin Order screen.

@kidunot89
Copy link
Member

@topheroes Any changes on this?

@plexus77
Copy link

Hi guys, I think I found the issue, on line 54 of the class-checkout-mutation.php

Seems that if either the ship_to_different_address or WC()->cart->needs_shipping_address() are false then the shipping fields are skipped, for some reason in my system WC()->cart->needs_shipping_address() is always false, perhaps because I have no shipping classes set... though that has never caused issues in the past when the site was not headless.

Anyway there is filter that can be used to override the check so that it is always true.

'woocommerce_cart_needs_shipping'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs researched
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants