VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: Creepzn on November 21, 2018, 11:40:15 AM

Title: Vendor Comments Not Saving Unless Order Status Changed
Post by: Creepzn on November 21, 2018, 11:40:15 AM
Hi there

Not sure if anyone has a solution for this, but when I try add comments on orders without changing the order status, the comments do not save. When changing the status of orders and simultaneously add a comment, the comments save.

I was able to add multiple comments without changing the status of orders to keep track of follow up calls etc.

Joomla version 3.9
VM Version 3.4
Title: Re: Vendor Comments Not Saving Unless Order Status Changed
Post by: Jörgen on November 21, 2018, 11:45:59 AM
In order list view or single order view ?

Jörgen @ Kreativ Fotografi
Title: Re: Vendor Comments Not Saving Unless Order Status Changed
Post by: GJC Web Design on November 21, 2018, 15:40:47 PM
Yes .. if the status isn't changed the "update" does nothing

it fails the check in the orders model

public function updateOrderHistory($inputOrder)

if(empty($oldHistoryRow) or $oldHistoryRow->order_status_code!=$inputOrder['order_status_code'])

if(empty($oldHistoryRow) or $oldHistoryRow->order_status_code!=$inputOrder['order_status_code']){
$_orderHist = $this->getTable('order_histories');
$inputOrder['comments'] = nl2br($inputOrder['comments']); //would be cooler in the table check function
$_orderHist->bindChecknStore($inputOrder);
}


You could mark this as a feature request as some sort of case or switch here to just save comments without  status change might be useful

or hack and comment out the if

or set it to another status with the comment then put it back to the previous
Title: Re: Vendor Comments Not Saving Unless Order Status Changed
Post by: Creepzn on November 22, 2018, 15:02:02 PM
Thanks for your responses. This happens in both single and list order view.
Title: Re: Vendor Comments Not Saving Unless Order Status Changed
Post by: Creepzn on November 22, 2018, 15:04:45 PM
The switching to another status is a temporary solution for now, but obviously not a great one at all. Will try comment out the "if", but where is that script?
Title: Re: Vendor Comments Not Saving Unless Order Status Changed
Post by: GJC Web Design on November 22, 2018, 16:26:50 PM
Quoteit fails the check in the orders model

public function updateOrderHistory($inputOrder)

if(empty($oldHistoryRow) or $oldHistoryRow->order_status_code!=$inputOrder['order_status_code'])


admin - vm - models - orders.php
Title: Re: Vendor Comments Not Saving Unless Order Status Changed
Post by: Creepzn on November 23, 2018, 07:26:55 AM
Thank you

I tried commenting that out, but the function of the order comments remained the same
Title: Re: Vendor Comments Not Saving Unless Order Status Changed
Post by: GJC Web Design on November 23, 2018, 10:15:20 AM
works for me

Title: Re: Vendor Comments Not Saving Unless Order Status Changed
Post by: mohtashimj on July 08, 2019, 12:26:56 PM
By commenting the if condition works for me.

Thank you!