Skip to main content

Backend manager see his self-made orders only

More
10 years 11 months ago #220836 by ibrahim3d
-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.5
-- Error-message(debug-mod must be tuned on) -- : Non

Hi,

I want to make staff to see/edit their own orders only,
I use hikashop to manage orders which we create for customers via phone, So
1- I need to know which staff created this or that order. DONE
2- I want to make staff see and edit their own orders only. YET
3-I want to to edit any order to make it disappear from one staff to another. DONE - By Fabrik.

I made number one with no problem with this plugin + making No-List fields "id = id of who created order" "staff = name of who created id" through HikaCustomFields.
Code:
<?php class plgHikashopstaff extends JPlugin { function plgHikashopName(&$subject, $config){ parent::__construct($subject, $config); } function onAfterOrderCreate(&$order,&$send_email) { $user = JFactory::getUser(); $staff = new stdClass(); $staff->order_id = $order->order_id; $staff->staff = $user->name; $staff->id = $user->id; $result = JFactory::getDbo()->updateObject('#__hikashop_order', $staff, 'order_id'); } } ?>

I tried to make number two but don't know where or how, I thought HikaDislplySomething should do but not sure,
Also tried to find the file which select order listing from DB didn't find it, Really complex for me.

I think code should like this, But where should I put it, Help me with this please,
Code:
If (access group is SuperUser){ Select all }elseif (access group is Spical){ select where id =Joomla-Current-User-ID }
Thank you

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

More
10 years 11 months ago #220839 by Jerome
Hi,

You can use the trigger "onBeforeOrderListing" for modifying the filters of the order listing in the backend.
Code:
function onBeforeOrderListing($paramBase, &$extrafilters, &$pageInfo, &$filters, &$tables, &$searchMap) { }

Regards,

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

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

Time to create page: 0.109 seconds
Powered by Kunena Forum