Hello,
I just want to use the function "getProductListing" in my module but with pagination system, I want it to accept $perPage paramater and $start paramater
1/ Can I use the existent funtion with pagination system (it will be great)
2/ Is there any solution, I can for example copy paste the code in my module and then modify it, but how can I modify it ?
Thank you.
getProductListing ( $group = FALSE,
$nbrReturnProducts = FALSE,
$withCalc = TRUE,
$onlyPublished = TRUE,
$single = FALSE,
$filterCategory = TRUE,
$category_id = 0
)
yes you can use it. The function works with pagination. Please read here http://dev.virtuemart.net/projects/virtuemart/wiki/Developing_a_module_or_plugin_for_VirtueMart_2
you need 3 lines.
if (!class_exists( 'VmConfig' )) require(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart'.DS.'helpers'.DS.'config.php');
VmConfig::loadConfig();
$pmodel = VmModel::getModel('product');
$myproducts = $pmodel -> getProductListing(....);
Thank you for your answer, but I know how to use that function, but didn't find a way to manage the pagination with that function, to pass $start and $limit parameters, actually what I did is copy and paste the function and change it to accept two more parameters ... it's not the best implementation but it works... now I have another problem it will be great you take a look : https://forum.virtuemart.net/index.php?topic=122261.msg417236
You must set the Pagination via Post or userstate stuff.