• Resolved majdawoocomm

    (@majdawoocomm)


    Hi,

    I already saw that someone created similar topic, but what confuses me is that it is marked as solved.

    Our problem is that, when someone purchases Gift Card only, order is set to completed, but if someone purchases gift card together with some other product, order is set to processing and no gift card is created or email is sent at all.

    Do you maybe know when this is going to be fixed, considering this is an emergency because of upcoming holidays and gift cards are being purchased, a lot.

    Thanks,

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author pimwick

    (@pimwick)

    Currently the gift card numbers are generated and emailed once the order is Complete. We have had a few customers request the gift cards get sent ahead of time and we are looking into a way to separate out “payment complete” versus “order complete”.

    In the meantime you can immediately send the gift card when the order is received by following these steps:

    1. Download the functions.php from your FTP server at /wp-content/themes/<your theme>/functions.php
    2. Keep a backup of functions.php in case there are problems.
    3. Edit functions.php and scroll to the very end and add this code.

    Note: if the last line is “?>” then put this code *above* that line. Otherwise, this code goes at the very end of the file:

    function custom_woocommerce_order_status_processing( $order_id, $order ) {
        global $pw_gift_cards_purchasing;
    
        $pw_gift_cards_purchasing->add_gift_cards_to_order( $order_id, $order, "order_id: $order_id completed" );
    }
    add_action( 'woocommerce_order_status_processing', 'custom_woocommerce_order_status_processing', 11, 2 );

    4. Save the functions.php file and re-upload it to your server.

    If you have any problems, replace functions.php with your backup file.

    Let me know if you have any questions!

    Plugin Author pimwick

    (@pimwick)

    Haven’t heard back so I’m going to mark this as Resolved, however if you still need assistance just let me know!

    Thread Starter majdawoocomm

    (@majdawoocomm)

    Thank you so much! Sorry, I just saw your message…

    Best,
    Majda

    Thread Starter majdawoocomm

    (@majdawoocomm)

    Hi again ??

    I just tried your code and it is sending gift card emails properly now and adding a gift card to gift cards as well. But the order remained with processing status…

    Is there a way to update order status as well, in order to be completed and not processing? We need order to be with completed status, because the only processing status order that we need to have are those that needs to be shipped and with gift card that is not the case.

    Thank you,
    Majda

    Plugin Author pimwick

    (@pimwick)

    Hi Majda,

    I’m not sure I understand your request. If an order contains only a gift card, it should automatically get marked as Complete. Make sure you still have this setting enabled under Pimwick Plugins -> PW Gift Cards.

    Orders that contain a gift card plus other physical products will be marked Processing. The code that I gave you will send the gift card immediately even though it is not Complete. As per your normal procedure, once you have shipped the physical products you should mark the order as Complete.

    Let me know if I’m missing a scenario!

    Thread Starter majdawoocomm

    (@majdawoocomm)

    Thank you for your fast response!

    You are correct and those two scenarios work as expected/correct. The problem is with the third scenario: if order contains a gift card and some non-physical (virtual) product. By WooCommerce, if some product is both, virtual and downloadable, order for that product will be with status completed. And that works for all our products that are both, virtual and downloadable. But if order contains virtual and downloadable product + gift card product, order will be with processing status.

    Considering that we need to distinct orders with physical products from orders that contain products that are not supposed to be shipped, we need this kind of orders to be with status completed as well. So, if I purchase one product that is virtual and downloadable and one product that is a gift card, your code from functions.php will send that gift card email, but my order will stay with processing status. So, problem is with non-physical product being bought together with gift card product. It works like this now:

    1) If order contains one/more product(s) that is/are virtual and downloadable, order will be with completed status.
    2) If order contains only gift card product, order will be with completed status.
    3) If order contains both, product from 1) and product from 2), order status will be processing —> We need this order to be with status completed as well because no shipping needs to be done.

    Hope the issue is more clear now.

    Thank you in advance,
    Majda

    • This reply was modified 5 years, 10 months ago by majdawoocomm.
    • This reply was modified 5 years, 10 months ago by majdawoocomm.
    Thread Starter majdawoocomm

    (@majdawoocomm)

    Thank you for your fast response!

    You are correct and those two scenarios work as expected/correct. The problem is with the third scenario: if order contains a gift card and some non-physical (virtual) product. By WooCommerce, if some product is both, virtual and downloadable, order for that product will be with status completed. And that works for all our products that are both, virtual and downloadable. But if order contains virtual and downloadable product + gift card product, order will be with processing status.

    Considering that we need to distinct orders with physical products from orders that contain products that are not supposed to be shipped, we need this kind of orders to be with status completed as well. So, if I purchase one product that is virtual and downloadable and one product that is a gift card, your code from functions.php will send that gift card email, but my order will stay with processing status. So, problem is with non-physical product being bought together with gift card product. It works like this now:

    1) If order contains one/more product(s) that is/are virtual and downloadable, order will be with completed status.
    2) If order contains only gift card product, order will be with completed status.
    3) If order contains both, product from 1) and product from 2), order status will be processing —> We need this order to be with status completed as well because no shipping needs to be done.

    Hope the issue is more clear now.

    Thank you in advance,
    Majda

    Plugin Author pimwick

    (@pimwick)

    Are you using another plugin to mark the orders complete automatically for Scenario #1? I just did a test order with vanilla WooCommerce and a Virtual product and the order was left as Processing.

    Thread Starter majdawoocomm

    (@majdawoocomm)

    No, we are not using any additional plugin, just WooCommerce.

    In order to have product order auto-completed, product must be set as both, virtual and downloadable. So, please set that virtual product as downloadable as well and make one test purchase. All of our orders with product(s) that are both virtual and downloadable are automatically set as completed. This is also suggested by WooCommerce on this link (please read first sentence): https://docs.woocommerce.com/document/woocommerce-order-status-control/.

    The problem is that this is not working if someone purchases those products together with gift card product, even though we set within your plugin settings to set orders with gift card product to completed.

    Plugin Author pimwick

    (@pimwick)

    Thank you for the clarification, I just confirmed and we’re looking into a solution for you. I will follow back up soon!

    Thread Starter majdawoocomm

    (@majdawoocomm)

    Great, looking forward to it, thank you!

    Plugin Author pimwick

    (@pimwick)

    We just released an update which fixes the issue for Scenario #1.

    To get the update:

    1. Log into your WordPress Admin area.
    2. Click on Plugins -> Installed plugins.
    3. Scroll down to PW WooCommerce Gift Cards and click “Check for updates.”
    4. The page will refresh, then scroll back down and click on “Update.”

    Let me know if that does the trick!

    Thread Starter majdawoocomm

    (@majdawoocomm)

    Great, thank you for that!

    I am on vacation currently, will test your update in a few days, when I get back and let you know about the results.

    Thread Starter majdawoocomm

    (@majdawoocomm)

    Hi! I just updated your plugin and order statuses are good now!

    Thank you so much for fixing this! Marking this as resolved…

    Best,
    Majda

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Order status processing, not completed issue is not solved’ is closed to new replies.