-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Friendly order numbers #184
Comments
It would be nice to be able to set a custom order number format too that is not necessarily sequential. |
Sorry guys, but how is this not already done? The numbering is not what clients are used to and having to add a plugin to get this working in an way that client's will accept is not cool. |
I completely agree with Anna about this - how is this not already done? It feels a bit hacky having to use a plugin for this (grateful though I am to the plugin developer for releasing it), as we now have a Reference number (the hash), an ID (the element ID I assume), and now a sequential friendly order number. :-/ |
We are considering adding friendly order numbers to Commerce 2-beta The question is to what extent. Would an integer only solution be enough? Will businesses expect to:
Please share your expectations. @sjelfull @bossanova808 @fantasticmachine @sm9 |
Hi Luke,
I would say that being able to control the prefix at a minimum.
Being able to format the number in some way would be awesome. This would ensure the numbering would fit into an existing system.
For instance, a recent client needed me to use the following format:
Prefix-yymmdd-orderNumber
… On 12 Jul 2018, at 12:29, Luke Holder ***@***.***> wrote:
We are considering adding friendly order numbers to Commerce 2-beta
The question is to what extent.
Would an integer only solution be enough? Will businesses expect to:
control the order number prefix?
have full control of the order number with something like Twig (with the incremented number being available)?
Please share your expectations. @sjelfull <https://github.com/sjelfull> @bossanova808 <https://github.com/bossanova808> @fantasticmachine <https://github.com/fantasticmachine> @sm9 <https://github.com/sm9>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#184 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAyeuanTQ5vS9ZSomF-VED9pODYYqRxZks5uFzMXgaJpZM4S_IJS>.
|
My thoughts are that the key thing is a consecutive integer, with a controllable starting point (so e.g. when you move systems your invoice number can carry on from where it was, or you start a new year and you increment from say invoice 10814 to 20000 or whatever, so there's an easy reference from the number to a point in time - i.e. the starting point should be changeable ongoingly, although not to a value less than has been used). In terms of prefix etc - I always imagined that would be done with a twig expression really? But I have not thought a lot about it as we just use integers ourselves. I do think the current (or next to be used) invoice number should be available as a twig variable (for silly ecommerce things like '20353 orders to date from customers just like you!' or whatever... and/or for doing maths like XXX order this month etc. I definitely think this is a basic, essential feature of any ecommerce system. UIDs are useless to day to day order processing people and customers - it's just not what they expect to use to find orders. And clearly element IDs in Craft itself won't work as they are non consecutive for orders (and thus should be mostly hidden as they just confuse things in the context). |
As we are getting more and more Commerce 2 sites in the works, this continues to be one of the most confusing elements for clients. As Jeremy (bossanova808) said, the UIDs are useless and confusing for serious businesses that rely on order numbers for daily customer service and internal workflow actions. Getting something basic here as an MVP would be a huge relief. |
@sjcallender @bossanova808 🎉🎉🎉 This uses the new "sequence" feature coming in the next release of Craft 3: craftcms/cms@edd3572 https://github.com/craftcms/commerce/blob/fe5034be1cf5aea4a3c574bd8c66f968818eb6df/docs/orders.md |
Hey Luke This is great to see! A couple of minor finishing things - people will need to facility to set a starting point for the sequence number, as many will be moving from existing settings. Is there a facility for this? I guess one could just do twig maths using say a global variable or something, but that seems a little naff....or I suppose twig maths will work in the mini-template too? If that is the intended mechanism. maybe update the docs with an example as that is bound to be a very common need for store operators. I also think that the back end order templates should be changed to show the reference number as the primary large number at top, like this: ...and of course it should really be in the orders element index, and most likely the default sorting mechanism for orders there-in, and ideally is even the thing you click on to go into the order: I've also opened an issue on Craft itself requesting that one can read the latest sequence number without incrementing it (using maybe an optional default false parameter to ...and finally, I will have a chat to you on Slack maybe about the best way of migrating my old Friendly order numbers to the new reference number, although I guess just looping through each order and copying the field value is that basic approach... |
@bossanova808 setting the new starting point for the sequence is done by updating the Not sure what you mean by If you want the number it can be retrieved with:
On migrating old friendly number, yeah, you would loop over order records in a batched manor and update the order reference column with the custom field value. |
BTW, unless it wasn't clear you could also make a manual entry into the sequence table with a new starting number. |
Ok - re non increment that query (if documented!) is probably enough but I'll let Brandon respond to the issue since he asked me to make one. I'm ok with editing a DB table of course, but shop owners may well want a UI for setting the starting number I would think. As they may want to do this each year or whatever...but I guess that is something you can gauge demand for/add later if need be! |
@bossanova808 the way the sequence function works is that it will start a new sequence when a new name/key is passed in. Passing in the dynamic year from the date as the key for example would automatically reset the counter. If you wanted to manually reset the counter, just update the name/key in the order reference format. |
@lukeholder the added migration fails for me with the following error:
Using PostgreSQL 10.5 |
@boboldehampsink just pushed fixes to develop branch if you want to try again. |
@lukeholder seems to be fine now, thanks :-) |
This was just released in beta 14: |
Use an auto increased integer for order numbers, just like https://github.com/bossanova808/CommerceFriendlyOrderNumbers. It should be awesome to add a prefix like "WEB" to get an order number like "WEB00001".
The text was updated successfully, but these errors were encountered: