• Resolved cochii

    (@cochii)


    Hello
    I have a site with woocommerce and several other plugins
    Depending on the role of the user, 2 shipping methods are available: free shipping and paid shipping (the minimum amount for free shipping and the price of paid shipping changes according to the role of the user)

    when modifying an order by an administrator, there is a recalculation of the prices of the order.
    Once this calculation is done, I would like to modify the shipping method of the order

    So far, I managed to retrieve the shipping modes for the user and the current shipping mode of the order
    Depending on the case, I would like to delete the current shipping method and put the new one in its place (so change the id, name and price for the current order)
    I can’t find how to do that

    Can you help me please ?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi @cochii

    Thanks for providing the details.

    Depending on the case, I would like to delete the current shipping method and put the new one in its place (so change the id, name and price for the current order) I can’t find how to do that

    You can do so in the “Billing” and “Shipping” screens. You’ll need to select the pencil icon next to each of them.

    IMAGE

    You can read more on editing order details here in our documentation: https://woocommerce.com/document/managing-orders/#order-details

    I hope this helps!

    Thread Starter cochii

    (@cochii)

    Hello @margaretwporg thanks for your response
    Excuse me, I forgot to specify that I wanted to do it automatically, in a piece of code that is executed automatically

    Hi @cochii

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone can 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.

    All the best!

    Thread Starter cochii

    (@cochii)

    Hello !
    I found how to delete a shipping method
    but to add one, I need help and maybe someone could help me

    I have an instance of WC_Shipping_Free_Shipping that I want to set in WC_Order_Item_Shipping
    Can I set only the ID and do something to update all data or I need to set all data (method_title, method_id, total, array of data with order_id, name, instance_id,all meta_data with all articles) ?

    Hi @cochii

    Code customization goes beyond the scope of support we are able to provide in this forum. If you need further help, I’d recommend the Facebook community and/or Slack for more development-oriented questions as recommended previously.

    This thread has been inactive for a bit, so I’m going to mark it as closed.

    Please feel free to open a new thread if you have any further questions.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Change shipping method’ is closed to new replies.