News:

Support the VirtueMart project and become a member

Main Menu

Need help on simple search plugin

Started by Khaostar, March 24, 2014, 18:27:34 PM

Previous topic - Next topic

Khaostar

Hi everyone!

I'm actually developping a site with Virtuemart 2. I'm creating a little "plugin" to search by multiple fields. In fact, I have a simple ajax / php query that I want to use. With this little search page, I can easily have the product ID that fits my search. But I'm stuck with it.

Simple explanation : I have an array of product ID. Now I want virtuemart to show all of these products. Is there any easy way to do that? a custom URL maybe?

I'm new to Virtuemart, a little help would be appreciated! :)

ITechnoDev

QuoteI have an array of product ID. Now I want virtuemart to show all of these products

There is a method named "getProducts" that returns products for given array of ids :

getProducts (   $productIds,
  $front = TRUE,
  $withCalc = TRUE,
  $onlyPublished = TRUE,
  $single = FALSE
)
   

For more information please check this documentation :

http://docs.virtuemart.net/api-vm2/dd/d5a/class_virtue_mart_model_product.html#aa69962a06ea1ebcd425e52290d57ca69
Extensions for VirtueMart : http://www.itechnodev.com

Khaostar

Thanks for the reply!

I found a solution by myself yesterday. I changed a bit my method and instead of sending the IDs of the products, i'm sending a custom query to the com_virtumart / category. That's perfect for my need. :)

thanks anyway!