Viewing 6 posts - 16 through 21 (of 21 total)
  • Author
    Posts
  • #5009
    stevence
    Participant

    I tried this as well, with no success. Custom function is added to functions.php, but customers are still able to view others orders. If I select edit own posts only, customer sees no orders at all.

    How to proceed?

    #5011
    Vladimir
    Keymaster

    It depends from which user your orders are created, who is the author of orders. Are your customers authors of their orders?
    I have a report that WooCommerce may register orders from a user with ID=1. URE edit restrictions will not help in this case. You can check this using SQL command, which shows orders list:

    
    SELECT * FROM wp_posts where post_type='shop_order';
    

    Look at the field ‘post_author’ value. Is this field contains different values or it is not?

    #5012
    stevence
    Participant

    Yes, ID = 1

    #5013
    Vladimir
    Keymaster

    WooCommerce support answered to one of my clients that they plan to change this with one of the future updates and write the customer ID to the order post_author field. I’m not sure when though.
    But if they will make that, it does not have sense to extract order customer ID from the post meta and make code more complex (slow) than it is now.
    What do you think?

    #5014
    stevence
    Participant

    See this discussion, probably in 3.5: https://github.com/woocommerce/woocommerce/pull/17895

    Waiting and updating to 3.5 probably will not fix old orders. Since these are just a few orders, I could manually change them in the backend, I guess. Any other suggestions?

    #5015
    Vladimir
    Keymaster

    Thanks for the link to the related discussion.
    They discussed and tested the update routine to replace orders post_author with related customer ID during database update for v. 3.5. So you will not need to update anything manually, I hope.
    Let’s wait 3.5 and see.

Viewing 6 posts - 16 through 21 (of 21 total)
  • You must be logged in to reply to this topic.