Vendor order listing limitation?

  • Posts: 2143
  • Thank you received: 747
9 years 10 months ago #157989

-- url of the page with the problem -- : local dev MAMP
-- HikaMarket version -- : 1.4.1

Hi Jerome,

Need to bother again... but first you should go to sleep this late holiday night - this isn't urgent... ;)

Prolog:
I can't help it, I'm having and using a few more order statuses than default.
For a number of reasons, my vendors must be informed of, and have an insight into orders only from a certain order status on.

Question:
How can I limit the display of orders in the frontend order listing for vendors depending on order status, meaning show orders with a certain status while not showing the others? Again, if it helps, the first few statuses must not show, while the last bunch of statuses shall show.

Been looking through bunches of view and helper PHP's already, but guess I'm too dumb to see it.

Thanks! And good night...


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )

Please Log in or Create an account to join the conversation.

  • Posts: 2143
  • Thank you received: 747
9 years 10 months ago #158008

Sorry Jerome,

But I just thought I had THE idea: "Use ACL on order statuses to block them from being seen!"

So, I went to edit the "created" order status and set ACL to only admins and super-users. Nope, "created" orders still in vendor's order listing view in frontend and accessible.
ACL to "None". No change, still the same.
I also unpublished the status. No change, still the same.

Just FYI, check on the Shop side: All the same as well, created orders listed for customer, emails on creation, etc.

And all the same for different order statuses as well.

Duh?! What am I forgetting/overlooking? Why am I expecting that an order status, technically a category, doesn't show anymore if I both unpublished it and set ACL to none? Seen it working with other category types, am actually using the feature for certain product categories.

Attached what might not be telling much more, but anyway.

Thanks for a nudge for where I'm wrong, if so.


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 26008
  • Thank you received: 4004
  • MODERATOR
9 years 10 months ago #158100

Hi,

You are right, we should be able to determine which order statuses the vendor can use.
HikaMarket does not load the ACL for the order statuses drop down, that's why this trick does not work.
I will see to add the code for that, or find another system to provide this feature.

My main idea was to add a "order status workflow" into HikaShop and does not really authorize vendor to change the status of the order but more "make an action".
Like "if the order is confirmed, you can ship it." which means that the button "ship it" won't appear if the order is not confirmed.

So the vendor won't have to choose an order status, he will choose to perform an action depending the current order status.
If the order is created, he will be able to "confirm it" when receiving the payment, etc.

For a first step, the ACL on the order status can be a good (and fast to implement) solution.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: lousyfool

Please Log in or Create an account to join the conversation.

  • Posts: 2143
  • Thank you received: 747
9 years 10 months ago #158144

Sounds good what you're saying. You're the expert, but guess your idea makes very good sense.

Every case is different, so for as long as flexibility remains, like e.g. adding order statuses (or maybe even removing/skipping/unpublishing one or more from the core), it should be good. See, not every Market is like an Etsy. My case, where I need more steps and keep vendors and customers separate until late in the order process, might be extreme, but think brokerage where you simply don't want customer and vendor to know each other or even communicate before a "secure" stage is reached in the transaction. Well, I'm sure you know.

I was looking at order status ACL as a workaround, fearing it to backfire somewhere on the Shop side, e.g. order statuses become useless or even blocked on the Shop side and the system coming to a screeching halt, eventually. While it might still a valid tool, let's keep an eye on possible side effects...
Next thing, maybe some "if" in PHP. I'm not good with that, but might need to try (or cry for help) if no other way.
Also found a way to hide orders with certain statuses per CSS, but you and I are not the only ones having a driver's license for Firebug or similar, so it's too unsafe, making it a no-no.

After all, your "official" solution looks best, and will be best, I'm sure. Usual question: when? Maybe I won't need an "if" condition, or long testing all across the site after applying ACL. Let me know if you need a guinea pig. Nope, not on a live site.

Thanks & cheers!


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )

Please Log in or Create an account to join the conversation.

  • Posts: 26008
  • Thank you received: 4004
  • MODERATOR
9 years 10 months ago #158291

Hi,

I checked the code and the type which is used while editing the order is the same used in the order listing (used for filters).
So I don't know if it can be a good idea or not to put the restrictions in the filter or it will be better to make two types (or two functions in the type) for the two kind of used.

But for the moment, if you want to make some tests, the HikaShop type "order_status" is the file you should look at.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 2143
  • Thank you received: 747
9 years 10 months ago #158292

Hi retour,

And thanks for digging further into this. I'll see when I get to it (was just dealing with some other stuff, as you can tell from my most recent post ;) ), but probably soon... I usually can't wait trying, lol...


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )

Please Log in or Create an account to join the conversation.

  • Posts: 2143
  • Thank you received: 747
9 years 10 months ago #158309

Me again.

Uhm, frankly, I have difficulties getting my head around what you said. You mean something like a "hard-coded filter" for what order statuses are being displayed in the listing? Hmm, would work (for me and some more) as a one-time setup, but can't be more than an interim solution, no?

You have the ACL for what a vendor can edit in an order, that's great. But IMHO there's got to be a pre-selection (ok, call it filter) for which order statuses he can access, even see.

Example: In the custom fields backend you have the "Display" fieldset with a bank of switches. I think that could work - would be nice, actually - in order statuses as well regarding vendor:
Vendor order listing: yes/no
Vendor order editing: yes/no

Or so. Well, just my 2 cents...

Ok, I'll still try to figure something out with order_status... not sure what'll come out, though, if any... ;)


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )

Please Log in or Create an account to join the conversation.

  • Posts: 2143
  • Thank you received: 747
9 years 10 months ago #158310

One-line addendum, speaking about ACL:
What about the order statuses showing up in the ACL (like product details), except the checkboxes enabling their display in the vendor order listing or not? Would keep it all together, nice and tidy?
Edit: And should keep the extra code short and sweet, or? Just some lines of "if's", no?


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )
Last edit: 9 years 10 months ago by lousyfool.

Please Log in or Create an account to join the conversation.

  • Posts: 26008
  • Thank you received: 4004
  • MODERATOR
9 years 10 months ago #158647

Hi,

Using HikaShop Business, the ACL on the order status already works but it is based on the user group, not the vendor group.
I am making some tests for the next release ; But regarding the current code in HIkaShop, a single "if" won't be enough.
We can add filters on the vendor groups or we can think about other solutions. But I will prefer to keep using the "loadAllWithTrans" function because this function works great with the multilingual components.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 2143
  • Thank you received: 747
9 years 10 months ago #158679

Jerome wrote: ... a single "if" won't be enough.


Well well, anything that direction wasn't meant too serious from my side... :whistle:

After initially opposing the "vendor group" approach (hard to manage?) when reading your post, on second thought I started liking it more and more.
Let's face it, the vast majority of admins treats their vendors all equally. And few exceptions among vendors, meaning moving some of them to a different group, can be dealt with. So, yes, if I were able to say, "vendor group A can see/access only order statuses 4 and 5", while "vendor group B can see/access all order statuses" (or none at all, for that matter - and whatever my default will be), that should do just fine. Along with the already existing possibility of applying a default group to vendors upon their registration, and ACL for what they can actually edit, I think this would make good sense and be a viable solution! If that's what you mean and I got you right... and not wanting to think of what it would take for implementation...


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )

Please Log in or Create an account to join the conversation.

  • Posts: 26008
  • Thank you received: 4004
  • MODERATOR
9 years 10 months ago #158681

Hi,

I think that using the HikaMarket ACL will be quite better. Because you can define a default configuration, change it by vendor or create configuration per vendor group.
We changed the way that the market ACL are displayed so now we do not have form input limitation.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 2143
  • Thank you received: 747
9 years 10 months ago #158704

Hi again,

Oh, so maybe I did get you wrong regarding "vendor groups".

Anyway, and as indicated before, making it part of the ACL sounds ideal to me. If the individual order statuses showed up in HikaMarket ACL and admin could use the checkboxes there to make each one visible/accessible for vendors or not - perfect!

Not sure if I understand your note on ACL display and form input limitation, but I guess we'll see in next release then? :)


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )

Please Log in or Create an account to join the conversation.

  • Posts: 26008
  • Thank you received: 4004
  • MODERATOR
9 years 10 months ago #158809

Hi,

The problem is quite complex because we might want to authorize some order statuses for the vendors ; the order statuses that they can set for an order, but also the order statuses which authorize them to edit the order status (In my head it sounded good).
You could accept that the vendor change the order from "created" to "confirmed" but not from "cancel" to "confirmed".

That's what I want to add, to provide you (users) a lot of flexibility to be able to configure whatever you want for the order workflow.
And yes, if I can find the perfect solution and implement it in the next release, I will be happy !

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 2143
  • Thank you received: 747
9 years 10 months ago #158825

Oh yes, if you want to get all that under one roof, I can imagine it being complex and getting complicated! It might get pretty complicated for the user (admin) as well unless you i.e. wrapped it into some "logical" step-by-step process, or so. Some ideas are coming to mind, but you might already have some as well...


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )

Please Log in or Create an account to join the conversation.

Moderators: Obsidev
Time to create page: 0.079 seconds
Powered by Kunena Forum