News:

Looking for documentation? Take a look on our wiki

Main Menu

getShipments() returns only first ten shipments

Started by SinyaWeo, August 26, 2013, 23:14:12 PM

Previous topic - Next topic

SinyaWeo

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

reinhold

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.

SinyaWeo

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