Viewing 3 replies - 46 through 48 (of 48 total)
  • @mike Jolley,

    Let me explain how we have set it up.

    1. The “multisafepay” plugin is used for configuration purposes so that all payment methods we offer can be configured on one location. We have created separate payment plugins that use the main module as a configuration module because. The payment plugin depend on the main module, if that one is not installed, the others can’t install (at least in our internal release). So the notification url used is always of the main module, as the functions that are process in the response function is the same for all methods. This way we don’t have to create separate full blown plugins for every payment method.

    2.The trigger for the new order email is configurable. This has been added by request of some of our merchants. They seem to have problems with those e-mails on some specific wordpress/woocommerce versions. That is why its added but is configurable.

    3.This has already beens solved internally for the next release, but this has nothing to do with the problem described within this topic.

    4. This has also been fixed in the internal release for the next update, think this one should also not cause the issue described within this topic.

    5. This has been done because there were some issues with a specific woocommerce update. We noticed that for some reason the updates didn’t work anymore and did work again using the prefix. Although after another woocommerce update it was working again. As the order is fully updated and the stock is processed, this should also should not cause the issue described withint this ticket.

    6. The notices are also fixed internally and will be in the next update, this should also not cause the issue described within this topic.

    This was a short explanation on why we did some things.

    It’s important that we can fix the problem for Mvdw as we won’t be getting far by blaming each other of this problem, so lets start looking at where we are now in my opinion:

    1. The Multisafepay plugin uses $order->payment_complete() to update the order as described within the Woocommerce API documentation. Notice the text “This will ensure stock reductions are made, and the status is changed to the correct value.” on the page:https://docs.woothemes.com/document/payment-gateway-api/

    2. Using the $order->payment_complete() function, the order is successfully updated and set as paid. Also, according to the order notes, the stock has now been processed. The order comments show that the stock has been reduced for the ordered products.

    3. As $order->payment_complete() updates the order and triggers the stock updates within Woocommerce, this function call should also trigger sending the low_stock and no_stock e-mails, and this doesn’t seem to work i.c.m. with our plugin.

    So we should look at the following questions:

    1. Does Woocommerce require some specific data being set within the order object before calling $order->payment_complete() that is needed to send the e-mails?

    2. If the answer to question 1 is yes, then what is that data and should our payment module set that data, or should it be done somewhere else?

    3, if the answer to question 1 is no, then the next question would be why somewhere further within Woocommerce something goes wrong with triggering the e-mails.

    As mentioned some post earlier, I did some debugging to figure out what is going wrong. I could trace the action to send the e-mails to be still working till the following Woocommerce code (so not part of our plugin):

    if ( ! $notification_sent && 'yes' == get_option( 'woocommerce_notify_low_stock' ) && get_option( 'woocommerce_notify_low_stock_amount' ) >= $new_stock ) {
    															do_action( 'woocommerce_low_stock', $product );
    														}

    Till the code above it all seems to work.

    Now, lets start looking deeper into the process of sending these e-mails instead of looking at what might be wrong within the plugin, even if it should not cause the problem described by the topic starter as the updating of the order does work as does the stock reduction as can be seen within the order notes.

    Plugin Contributor Mike Jolley

    (@mikejolley)

    @multisafepaydev can you email instead? This forum is a bit naff ?? [email protected]

    Thread Starter Mvdw

    (@mvdw)

    @mike, did you receive the emails from Ruud? Is it possible to answer the emails soon?

Viewing 3 replies - 46 through 48 (of 48 total)
  • The topic ‘No email low stock’ is closed to new replies.