Hello,
i’m using an csvi-template for exporting virtuemart-orders, with the option „Since last run“
Since my Update to joomla 5.4.4, virtuemart 4.6.8 and ro-csvi I have a problem with not selected orders.
In the log-File I found the (in my opinion) relevant code:
WHERE zv8oh_virtuemart_manufacturers.virtuemart_manufacturer_id IN (2) AND DATE(zv8oh_virtuemart_orders.created_on) > '2026-04-17 04:21:54' AND zv8oh_virtuemart_orders.order_status IN ('U','C','S') AND user_info1.address_type = 'BT'
I tried this in mySQL
select virtuemart_order_id, created_on from xxxx_virtuemart_orders where DATE(xxxx_virtuemart_orders.created_on) > '2026-04-17 04:21:54' order by virtuemart_order_id DESC;
0 rows selected
By manually changing the date I get some orders:
select virtuemart_order_id, created_on, DATE(created_on) from zv8oh_virtuemart_orders where DATE(xxxx_virtuemart_orders.created_on) > '2026-04-16 04:21:54' order by virtuemart_order_id DESC;
I assume the problem is „DATE“ because DATE returns no time (or maybe 00:00)
In my tests it works without „DATE“:
select virtuemart_order_id, created_on, DATE(created_on) from zv8oh_virtuemart_orders where xxxx_virtuemart_orders.created_on > '2026-04-17 04:21:54' order by virtuemart_order_id DESC;
(see the examples in attachments)
So what can I do to solve the problem in my template?
best regards, Norbert
Hi Norbert,
You are correct, the issue is that the DATE is added so you are comparing against the date only and no time. I will work out a fix and post it for you once it is ready.
A quick fix would be to replace line 888 in the file plugins/csviaddon/virtuemart/com_virtuemart/model/export/order.php with the following code:
$query->where($this->db->quoteName('#__virtuemart_orders.' . $checkDatefield) . ' > ' . $this->db->quote($lastRun));
That should get it going again.
Let me know how it goes.
Kind regards,
RolandD
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Hi Roland,
thanks for your answer.
I have found the option "Last used order ID".
Could this also be an alternative to "since last run"?
Kind regard, Norbert
Hi Norbert,
So I have fixed the issue and have a patch available for you. You can load the patch file and run your export. The issue should be fixed then.
Let me know how it goes.
Kind regards,
RolandD
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Hello rolanndd,
thanks for your prompt support. I works well!
Kind regards,
Norbert
Log in to reply to this topic.