Custom order statuses

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #85594
    Lars Bach
    Participant

    Hello,

    I have a bunch of custom order statuses, that I want orders to get depending on product bought (I use product tags for the rules).

    However, I have made the following rule:

    Status from: Processing

    Status to: Factory (<- custom order status)

    Product tags: [factory]

    However, when this rules is triggered, the order status goes from “processing” to “on hold”.

    The following log entry is added to the order:

    Status updated by “Order Status Rules for WooCommerce” plugin (Rule #2: Processing > Factory). Order status changed from Processing to On hold.

    The order then just stays “On hold”, nothing more happens and I don’t understand why when I have set to the rule #2 to change it into “Factory” instead?

    #85595
    Tom Anbinder
    Moderator
    Plugin Support

    Hi Lars,

    Sorry for the late reply.

    Would it be possible to share access to your site, so I could log in and check what’s going on (my email is [email protected])? Please let me know if sharing an account is not an option, and I will continue solving it remotely.

    #85596
    Lars
    Guest

    No worries Tom, I have created an admin user for you now. It’s just a test site so your hands are free to do what you want. You are most welcome to change the language into English if Danish is giving you problems 🙂

    Cheers!


    Lars

    #85597
    Lars
    Guest

    Hello again Tom,

    Its probably worth mentioning that the custom order statuses I have configured, are visible under “Tools” > “Advanced Scripts”
    I am by no means a programmer in any way and the snippet consists of bits and pieces I have found on stack overflow – so I am of course wondering whether it is my shabby code that is causing the problems.

    However, I am able to select these custom statuses in the plugin rules, as you can see, so it seems it should be able to work.

    #85598
    Tom Anbinder
    Moderator
    Plugin Support

    Hi again, Lars,

    I’ve logged in and hopefully managed to fix the issue. As you correctly guessed, it was connected to your custom code for adding custom statuses in the “Advanced Scripts”. In the “Location” option there, you had “Administration area”. I’ve changed it to “Everywhere” – rules seem to be working fine now. Please give it a try and let me know what you think.

    P.S. There is one more thing about your custom order statuses. The register_post_status() function documentation says that:

    20 is the maximum character length for the $post_status parameter.

    Two of your statuses exceed that.

    #85599
    Lars
    Guest

    Hi Tom,

    Thanks so much for the quick assistance with my utterly worthless coding attempts 🙂

    I suspect that the two statuses that goes beyond the 20 characthers limit are, “Gavekort Fysisk” and “Gavekort Online”?

    But when I count those two using for example https://wordcounter.net/, I get them both at 15 characthers?

    It was only just now that I saw you also have a plugin for creating custom order statuses, so I might just go ahead and buy that instead of coding it myself.

    #85600
    Tom Anbinder
    Moderator
    Plugin Support

    Happy to help 🙂

    > I suspect that the two statuses that goes beyond the 20 characthers limit are, “Gavekort Fysisk” and “Gavekort Online”?

    It’s not the name of the status, but its slug, i.e., wc-order-giftcard-online and wc-order-giftcard-physical – both are over 20 characters.

    > It was only just now that I saw you also have a plugin for creating custom order statuses…

    Yes, we do have this plugin. And it has some additional features, like sending an email on status change.

    P.S. If you like the plugin, please consider leaving me a rating here or here.

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.