Plugin to further extend product info from external resources

Started by Greg P, July 28, 2012, 17:04:18 PM

Previous topic - Next topic

Greg P

I need to add custom code (presumably a plugin) that gets additional data from external sources (via our databases as well as external APIs) when the product is retrieved and displayed to the user.  It is dynamic data that cannot be manually added such as sku, price, weight, etc., and must retrieved when the product is viewed.

For simplicity sake, the example I'll use is Stock Market information.  I've configured a custom field called Stock Symbol, which remains constant.  When the product page is being displayed, I need to have access to whatever the current stock price might be (having been retrieved via an API service using Stock Symbol), and also to data that is stored in non-Joomla/VM databases on our server, such as stock market reviews, or recommendations, etc., also using Stock Symbol.

In the same way that the Product Name or SKU can be retrieved, I need something similar to this. 

<?php
    
echo "Product name is:"   $this->product->product_name ;
    echo 
"Stock Symbol is: "  $this->product->StockSymbol;     //This is a VM custom field, I just don't know how to properly access it for echoing in this example
    
echo "Current Prices is:" $this->product->mystuff->MarketPrice;     //Retrieved via API, such as NY Stock Exchange or similar
    
echo "Our data is:"       $this->product->mystuff->TodaysEditorial//Retrieved from ANOTHER of our non-Joomla databases
?>



The method of getting the external data is irrelevant, and provided for the example only.  The necessity is to have an "installable" plugin for all our sites, that can extend the product object with this standard data at the same time that the VM product info is retrieved, so a plugin that is fired when the product is retrieved from the database seems to be the logical answer, and is the ideal solution, I just can't figure out where/how to do that.

I've found various places that I could hack it in, but of course do NOT want to do that, and tried to work from other VM plugins, but can't determine which are native to VM and subject to upgrades, and which are "addins" that will be untouched by updates.  Scanning the code for "plugin", "custom", "product" gives me almost every line of code on the site, lol, and all the existing VM plugins seem to be geared towards functions such as checkout, payment, shipping, etc., rather than getting product information before the product page is even displayed.

I LOVE the new VM, but am completely lost as to what such a plugin would be properly named, or where it would exist, relative to VM, or to Joomla, to be properly called for my purposes.

PolishedGeek

This would be a very cool plugin, and could really expand the integration capabilities of VM2. Unfortunately, I don't know what someone would call that kind of plugin either.

My company has built a lot of custom external integration extensions, but nothing quite like that.  And unfortunately I haven't heard of anyone else building anything like that either. It's one thing to pull external data into the product page that doesn't vary based on the item. It's quite another to pull in specific externally housed information specific to the product being viewed, and display it dynamically on the product page (and with minimal to no impact on page load time, of course).

Please do update this thread with news if you locate something that does the trick, or if you commission for it to be custom developed. I'm really curious about how this topic turns out.  :)
~ Deb Cinkus, CEO
Polished Geek, LLC   |    www.PolishedGeek.com

Creators of JoomLister - eBay Lister for Joomla!

PolishedGeek

~ Deb Cinkus, CEO
Polished Geek, LLC   |    www.PolishedGeek.com

Creators of JoomLister - eBay Lister for Joomla!