-- HikaShop version -- : 2.3.3.
-- HikaMarket version -- : 1.4.4
-- Joomla version -- : 3.3.4.
Hi Jerome,
We're in really final stage after long months of work and "playing" with the code.
2 small problems we noticed, both related in updating the main order (sale).
1.) In default a subvendor is not permitted to delete items from the order. After modifing the template (show_products.php) delete button is shown, and after a page refresh the item is deleted.But the item is just deleted from the sub-sale, in sale it's still shown. I know that deleting is a main vendor's only right, but we should need it to work for sub-vendor as well.
2.) We have 2 fields for each ordered item which are empty in default by custom reasons. But the user who made the order should fill these fields later. We have solved it by editing show function in /components/com_hikashop/views/view.html.php but the problem is the same as in 1.), the main order is not updated, just the subsale.
function show(){
$type = 'order';
$order =& $this->_order($type);
$config =& hikashop_config();
$download_time_limit = $config->get('download_time_limit',0);
$this->assignRef('download_time_limit',$download_time_limit);
$download_number_limit = $config->get('download_number_limit',0);
$this->assignRef('download_number_limit',$download_number_limit);
$order_status_download_ok=false;
$order_status_for_download = $config->get('order_status_for_download','confirmed,shipped');
if(in_array($order->order_status,explode(',',$order_status_for_download))){
$order_status_download_ok=true;
}
$this->assignRef('order_status_download_ok',$order_status_download_ok);
$popup = hikashop_get('helper.popup');
$this->assignRef('popup',$popup);
hikashop_setPageTitle(JText::_('HIKASHOP_ORDER').': '.$this->element->order_number);
if(isset($_POST['update_teteldatum'])){
$app = JFactory::getApplication();
$db = JFactory::getDBO();
$order_id = JRequest::getVar('order_id');
$product_id = JRequest::getVar('product_id');
$redirect_url = JRequest::getVar('redirect_url');
$data = JRequest::getVar('data', array(), '', 'array');
if(!JSession::checkToken()) {
$app->enqueueMessage(JText::_('INVALID_TOKEN'), 'error');
} else {
if( (!isset($data['item']['kiszallitva_tetel'])) || ($data['item']['kiszallitva_tetel']==='00000000000') || (!isset($data['item']['szallitolevel_szama'])) || (empty($data['item']['szallitolevel_szama'])) ) {
$app->enqueueMessage(JText::_('A dátum és/vagy a szállítólevél száma mező üres!'), 'error');
}else {
$query = 'UPDATE '.hikashop_table('order_product').' SET kiszallitva_tetel='.$db->Quote($data['item']['kiszallitva_tetel']).', szallitolevel_szama='.$db->Quote($data['item']['szallitolevel_szama']).' WHERE order_product_id='.$db->Quote($product_id);
$db->setQuery($query);
$result = $db->query();
//$mainframe->$redirect_url;
JError::raiseNotice( 100, 'A kiszállítás dátuma és a szállítólevél száma elmentve!' );
JFactory::getApplication()->redirect($redirect_url);
//return;
}
}
}
}
Thanks for your help and patience in advance.
Regards,
PePe