News:

Support the VirtueMart project and become a member

Main Menu

Execute custom code when a product is clicked

Started by amanwas, September 28, 2012, 10:54:49 AM

Previous topic - Next topic

amanwas

Hi All,

I am developing a site in Joomla 2.5 and using Virtuemart 2. The site is for Mobile Shops. The purpose is to display user the nearest shop and the shop with cheapest price for the selected phone.

We planned to use Google Maps for distance calculations using Longitude and Latitude.

We added 3 custom tables to our database.
tbl_Shops                (shopid, shopname)
tbl_Phones              (phoneid,phonename)
tbl_PhonesPrices    (shopid,phoneid,price)

Now what I want is when a user clicks on any mobile phone in virtuemart (be it a category page or home page or any other page), I need to execute my custom code to check its (ProductId or ProductSKU) against my own custom tables. Then my code will return 2 records, one for shop with cheapest rate and one for nearest shop.

I want to know where to insert that code so that when a user click on any product, it does not redirect to Product Page instead control passes to my own code.

Many Many thanks in advance.

I am new to virutemart but have good knowledge of Joomla.