How to see Vendor statistics from front-end?

  • Posts: 19
  • Thank you received: 0
7 years 11 months ago #257809

-- HikaShop version -- : 2.6.4
-- HikaMarket version -- : 1.7.2
-- Joomla version -- : 3.6.4

Hello,

I have Main Vendor, with multiple users (let's call them Sub-Main Vendors).
1- The shopper buy a product.
2- The order automatically assigned to the Main Vendor.
3- The Main Vendor (from-end) assigns the shopper's order product (sub-order) to a specific Sub-Main Vendor.

What I need is a way that allows the Main Vendor see the Sub-Main Vendors sub-orders.

So for example the view will see:
Order Number | Order Status | Order Date | Order Vendor

Also I need something like a quick statistics, same as shown on the Front-End Order Listing view.
That can show for each Sub-Main Vendor how many order are Delivered, how many are Cancelled, how many are Shipped... etc.

Hope this helps understand my need and guiding me,
Kindest regards.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
7 years 11 months ago #257825

Hi,

There is :
- The main vendor (and his users).
- The vendors (and their users).

An "order" is visible by the "main vendor".
A "sub order" is visible by the "vendors" ; they are created dynamically when the "order" is created and it contains some product assigned to some vendors.

When you display an "order", you can see the list of his "sub orders" ; and you can also click on these "sub orders" to see the details.

I don't know how you want to do these "sub-main vendor orders" ; how you're performing the association ; so I don't know how you can perform such kind of filter.

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: 19
  • Thank you received: 0
7 years 11 months ago #257835

Hi Jerome,
Alright, let me explain it in another way.


I have 1 Main Vendor and 5 Vendors
I have Vendor selector on ordering process that makes any order assigned automatically to the Main Vendor

After order creation (and assignment to Main Vendor), the Main Vendor uses his front end cp and edit the order products and assign the products to one of the Vendors to handle it.

Since I previously knew from you that orders cannot be assigned to Vendor, but only Sub-Orders can; I now have many Sub-Orders with different statuses (created/shipped/delivered/cancelled) each assigned to a Vendor.

My question is about seeing statistics of these Vendors, for example:-
1- How many Sub-Order Vendor 1 has?
2- How many are shipped?
3- How many are cancelled?



Hope this explains my need and be able to help me,
Kind regards.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
7 years 11 months ago #257862

Hi,

That organization is a possibility I explained sometime to give an "order edition access" to the vendor before that the real feature is implemented.
But that possibility is not a full safe solution and it's not a long term solution too.

At the moment that an account is assign to the "main vendor", he will be able to access and edit any order (sub-orders are not editable).
The vendor access see their own statistics in their dashboard ; the main vendor will see the store statistics but he does not have an interface to manage vendors in the front-end ; that's why the vendor statistics are available in the backend for the administrators.

Thanks to some view override, you can add your own PHP code and display some statistics ; but you will need to know to which "vendor" the account is assigned.
Afterwards, some code from the statistics could be re-use so you will be able to perform the queries you want and display the results as "graphics".

I know that the "order edition for vendors" is taking a lot of time and I'm really sorry for that delay ; but with the work on HikaShop 3 ; I wasn't able to progress as I wanted to every projects in parallel.

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: 19
  • Thank you received: 0
7 years 11 months ago #257869

Hi Jerome,
I appreciate your help and thank your patience.

Alright, I will tell you in details what I was trying to do and will answer your generous replies for all my topics; however, let me go directly to questions at the mean time just to finish my late project and focus afterwards on developing what is better for all of HikaShop fans.

Speaking about the front-end main vendor order listing view:-
In the database table hikashop_order there's a column called "order_vendor" (which I have created using the custom field feature).
I want a string that for each hkorder.order_id in the listed table, it fetches the corresponding value from the column order_vendor , then it goes to the table hikamarket_vendor and locate the fetched value in the vendor_id column then finally print the corresponding value from vendor_name column.

Is there a way to do that using, for example, HikaShop MVC?


Your prompt and positive feedback is gratefully thanked,
Sincerest regards.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
7 years 11 months ago #257876

Hi,

In the table "hikashop_order", you have some fields :
* order_type : sale / subsale
* order_vendor : 0 (when "sale") / the vendor id (when "subsale")

In the table "hikamarket_vendor", you have some fields :
* vendor_admin_id : the hikashop user id

In the table 'hikashop_user" you have some fields :
* user_vendor_id : the vendor_id to which the user is assigned (vendor users, not admin)
* user_vendor_access : the access that the user have for the vendor.

So a user can be assigned to just one vendor account.
But a user can be administrator of several vendors.

By linking the accounts to the main vendor, they have "1" in the field "user_vendor_id" but you can find their "user_id" in the column "vendor_admin_id" of the table vendor.

Now about the orders ; only the sub sales are linked to a vendor. A sale stay a sale ; it is created by HikaShop and is for the customer (and the backend). Elements related to HikaMarket are in the "subsale" types.
But you can use the "order_parent_id" to link a "subsale" with a "sale".

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.

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