News:

Support the VirtueMart project and become a member

Main Menu

Jump to product from user inputed SKU.

Started by vaistik, June 28, 2013, 12:11:15 PM

Previous topic - Next topic

vaistik

Greetings Virtuemarters!

I need to create a way for a user to jump to a certain product details page for which he/she will provide the SKU.

I've used some JS to create a form that can use the product id to do that.

index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=XX

I'm trying to find a way to either:


  • get the product id from the sku with a secure ajax call.
  • send the sku in the get and create a function that can grab the product (index.php?option=com_virtuemart&view=productdetails&virtuemart_product_SKU=XX)

I'd much preffer the second method as it seems more secure. I've looked around the product model but couldn't figure out how to do it.

Could anyone point me to where the function that gets the product from the id is and how could I copy and alter it to use the sku?

Any ideas are welcome though!

PS: I've also found this thread but had no answer. Sorry if this is considered a repost!

vaistik

Update for anyone looking for something similar.

Found this thread that helped alot!