• Resolved tezalsec

    (@tezalsec)


    Hi,

    Would it be possible to get a prefix in which the current year is included?

    Like: $prefix = ‘ASN’ . Date(‘Y’);

    Or do you have a filter so I can add that myself?

    Thanks. Cheers.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author WebToffee

    (@webtoffee)

    Hi @tezalsec,

    Please try adding below code snippet to your active theme’s functions.php

    add_filter('wt_order_number_sequence_prefix', 'webtoffee_order_number_sequence_prefix_only', 10, 1);
    function webtoffee_order_number_sequence_prefix_only($perfix){
       return "ASN_" .date('Y');
    }
    Thread Starter tezalsec

    (@tezalsec)

    Thanks, it is working.

    Maybe correct the $prefix variable in your code for others reading this thread.

    Cheers.

    • This reply was modified 5 years, 3 months ago by tezalsec.
    Plugin Author WebToffee

    (@webtoffee)

    Hi @tezalsec,

    Great. Leave us a review if you like the plugin. Thanks!

    Hello,

    How can I modify the above snippet to add the prefix {YYYY}{MM}{DD}-{order_number}?

    Will it be possible to add this feature to add a custom feature to a future update?

    Thanks

    Plugin Author WebToffee

    (@webtoffee)

    Hi @barnabas1,

    Please try using the code snippet here.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘custom prefix with current year’ is closed to new replies.