-- url of the page with the problem -- :
mywebsite.com/mypage
-- HikaShop version -- : 1.5 i think
-- Joomla version -- : 2.5
-- PHP version -- : 5.3
Hi guys,
In the code I have for a successful transaction there is this line
$order_text = "\r\n".JText::sprintf('NOTIFICATION_OF_ORDER_ON_WEBSITE',$dbOrder->order_number,HIKASHOP_LIVE);
but I dont think it works because I can't get the order number from it. How can I get the order number for the just created order?
Thanks,
Mat
full case code: function onBeforeOrderCreate
case EWAY_TRANSACTION_OK:
$order->history->history_reason=JText::sprintf('AUTOMATIC_PAYMENT_NOTIFICATION');
$order->history->history_notified=0;
$order->history->history_amount= round($order->cart->full_total->prices[0]->price_value_with_tax,2).'USD';
$order->history->history_payment_id = $order->order_payment_id;
$order->history->history_payment_method =$order->order_payment_method;
$order->history->history_data = '';
$order->history->history_type = 'payment';
$order->order_status = $method->payment_params->verified_status;
$mailer =& JFactory::getMailer();
$config =& hikashop_config();
$sender = array(
$config->get('from_email'),
$config->get('from_name') );
$mailer->setSender($sender);
$mailer->addRecipient(explode(',',$config->get('payment_notification_email')));
$url = HIKASHOP_LIVE.'administrator/index.php?option=com_hikashop&ctrl=order&task=listing';
$order_text = "\r\n".JText::sprintf('NOTIFICATION_OF_ORDER_ON_WEBSITE',$dbOrder->order_number,HIKASHOP_LIVE);
$order_text .= "\r\n".str_replace('<br/>',"\r\n",JText::sprintf('ACCESS_ORDER_WITH_LINK',$url));
$mailer->setSubject(JText::sprintf('PAYMENT_NOTIFICATION','eWAY','Accepted'));
$body = str_replace('<br/>',"\r\n",JText::sprintf('PAYMENT_NOTIFICATION_STATUS','eWAY','Accepted')).' '.JText::sprintf('ORDER_STATUS_CHANGED',$order->order_status)."\r\n\r\n".$order_text;
$mailer->setBody($body);
$mailer->Send();
break;