• Resolved okoo

    (@okoo)


    Hi there!
    I’ve already wrote you in the past (https://wordpress.org/support/topic/idea-for-improvement/) asking for help in improve a function: change the status order on a specific date that was defined with an ACF.

    The solution you provided worked fine, but I later found out that for variable products it wasn’t working fine, because the field I’ve added didn’t appeared inside the variations postmeta, so I had to add another custom fields for variations (and I have to add values for every variations inside WooCommerce).

    Right now I was wondering if there’s a way to have a code were the plugin takes, for variable products, the value of the parent’s product ACF field in order to change the order status (I don’t know if it’s clear, in case let me know and I will try to explain it better).

    Thanks!

    • This topic was modified 2 years, 2 months ago by okoo.
    • This topic was modified 2 years, 2 months ago by okoo.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @okoo,

    Thank you for reaching out.

    We apologize for the inconvenience you have experienced. We understand that you are facing some issues with the function we provided earlier for changing the status order on a specific date defined with an ACF.

    We have escalated your concern to our development team for further investigation. They will get back to you as soon as possible.

    Thank you for your patience and understanding.

    Kind regards,
    Moshtafizur

    Thread Starter okoo

    (@okoo)

    Thanks!

    Plugin Author Algoritmika

    (@algoritmika)

    Hi @okoo,

    I think what you need is simply change this line in our snippet:

    $product_id = ( ! empty( $item['variation_id'] ) ? $item['variation_id'] : $item['product_id'] );

    to:

    $product_id = $item['product_id'];

    This way, it will always use the parent product ID for variations.

    P.S. Generally, you can always get the parent product ID with the wp_get_post_parent_id() function, e.g.:

    $product_id = ( 0 != ( $parent_id = wp_get_post_parent_id( $product_id ) ) ? $parent_id : $product_id );

    I hope this helps. Please let me know if you have any questions.

    Thread Starter okoo

    (@okoo)

    Thanks!
    I’ve tried and it seems to work! I will check in the next few days if everything’s fine 🙂

    Thanks again for now!

    Plugin Author Algoritmika

    (@algoritmika)

    Happy to help 🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Change the status of order on a specific date for variable products’ is closed to new replies.