Hi all,
I'm trying to use getShipments() function but it only returns first ten shipments. Please see the code:
$shipmentModel = VmModel::getModel('shipmentmethod');
$shipmentModelList = $shipmentModel->getShipments();
vmdebug('SM', $shipmentModelList);
Is there any parameter needed to get all the shipments?
Thank you for any answer.
Milan
Whithout actually trying it out (but looking at the VmModel code), I think you need to set the model's _noLimit member to true, otherwise the pagination from the VM configuration will be used:
$shipmentModel = VmModel::getModel('shipmentmethod');
$shipmentModel->_noLimit = true;
$shipmentModelList = $shipmentModel->getShipments();
Check the VmModel's exeSortSearchListQuery function (./administrator/components/com_virtuemart/helpers/vmmodel.php, line 347) to see why. Unless _noLimit is set, the function called by getShipments will use the default pagination routine to limit the number of results.
Quote from: reinhold on August 26, 2013, 23:56:17 PM
Whithout actually trying it out (but looking at the VmModel code), I think you need to set the model's _noLimit member to true, otherwise the pagination from the VM configuration will be used:
$shipmentModel = VmModel::getModel('shipmentmethod');
$shipmentModel->_noLimit = true;
$shipmentModelList = $shipmentModel->getShipments();
Check the VmModel's exeSortSearchListQuery function (./administrator/components/com_virtuemart/helpers/vmmodel.php, line 347) to see why. Unless _noLimit is set, the function called by getShipments will use the default pagination routine to limit the number of results.
Thank you so much. That is exactly what I needed.
Milan