Jerome wrote: Hi,
I don't understand your last problem ; what is the "if I have more fields in the list" ? Which list ? How ?
The way that you display the field is good but the value you have to the field Class is not the good one
$data->kiszallitva_tetel.$product->order_product_id
Why are you concatenate the order product id to the existing value of the custom field ?
Regards,
Sorry, I copied the wrong lines, as I want to achieve almost the same to every each ordered items on a field named that.
I successfully solved the earlier described problem by adding in datepickerfield_class.php to $id variable a randomly generated number, so in this way, the multiple fields are loaded in listing view, now loaded with different ids, so they are not confused.
So, now in listing view I successfully solved to modify the order_status and adding date field by pushing just one click.
I also wanted to use the same method on show the order page (example link: /index.php?option=com_hikashop&ctrl=order&task=show&cid=353&Itemid=139)
But it gives a 403 error, maybe because this is a task page already? Or I don't know, just getting deeper in Joomla.
I wanted to use that function, but maybe I do not implemented it to the right place, or maybe I'm calling it not the right way.
function tetelkiszallitas_update(){
$app = JFactory::getApplication();
$order_id = JRequest::getVar('order_id');
$product_id = JRequest::getVar('product_id');
$redirect_url = JRequest::getVar('redirect_url');
if(isset($data['product']['kiszallitva_tetel'])) {
$query = 'UPDATE '.hikashop_table('order_product').' SET kiszallitva_tetel='.$db->Quote($data['product']['kiszallitva_tetel']).' WHERE order_product_id='.$db->Quote($order->order_number);
$db->setQuery($query);
$result = $db->query();
}
$redirect_url = JRequest::getVar('redirect_url');
$app->redirect($redirect_url);
return true;
}
And the code that tries to use this in view/order/show.php:
<form id="adminForm_<?php echo $product->order_product_id; ?>_kiszallitott" action="#" method="post" name="adminForm_<?php echo $product->order_product_id; ?>_kiszallitott">
<div class="szallitas_mezok_lista szallitas_mezok_<?php echo $product->order_product_id; ?>" style="display:none;">
<?php
$orderClass = hikamarket::get('shop.class.order');
$productClass = hikamarket::get('shop.class.product');
$fieldsClass = hikamarket::get('shop.class.field');
$fields = $fieldsClass->getFields('frontcomp',$item,'item','checkout&task=state');
?>
<?php //echo $row->kiszallitva_igenyles;
echo $fieldsClass->display($fields['kiszallitva_tetel'], $data->kiszallitva_tetel, 'data[product][kiszallitva_tetel]');
?>
<button type="submit" class="btn btn-large right" name="tetelkiszallitas_update" value="MENTÉS" onclick="var field=document.getElementById('<?php echo $product->order_product_id; ?>');document.adminForm_<?php echo $product->order_product_id; ?>_kiszallitott.submit();return false;">MENTÉS</button>
</div>
<input type="hidden" name="Itemid" value="<?php echo $Itemid; ?>"/>
<input type="hidden" name="option" value="<?php echo HIKASHOP_COMPONENT; ?>" />
<input type="hidden" name="task" value="tetelkiszallitas_update" />
<input type="hidden" name="product_id" value="<?php echo $product->order_product_id; ?>" />
<input type="hidden" name="order_id" value="<?php echo $this->order->order_id; ?>" />
<input type="hidden" name="ctrl" value="<?php echo JRequest::getCmd('ctrl'); ?>" />
<input type="hidden" name="redirect_url" value="<?php echo hikashop_currentURL(); ?>" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
Any help would be really appreciated...