-- 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.
<?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,
If (access group is SuperUser){
Select all
}elseif (access group is Spical){
select where id =Joomla-Current-User-ID
}
Thank you