News:

Support the VirtueMart project and become a member

Main Menu

Custom Plugin Help Required

Started by quayfee, October 16, 2012, 00:11:17 AM

Previous topic - Next topic

quayfee

Hi All,

I'm trying to write a custom product plugin that will check to see if the current product has any children and, if it does, replace the price with 'From' and the lowest price from the children.

I have method to do this involving a simple template override and a custom plugin using the plVmOnDisplayProductFE event hook.

The problem that I'm having is that while the event triggers the plugin, the only way that I can get any output from the plugin (I'm still at the 'Hello World' stage to test output) is to directly print using print / echo within the method for that hook. As expected this simply dumps the output at the top of the code block where the plugin is executed. According to the plugin documentation this method should return HTML (http://dev.virtuemart.net/projects/virtuemart/wiki/Product_Plugins), and I would expect to find that output returned in the objects display property. However doing a print_r on the object into the template shows that the display property is blank...

I've also tried populating the display property directly from within the plugin with $this->display = ... but to no avail.

I'd really appreciate some help to get this bit kicked off. once I can get something output the rest is just db queries... :)

Thanks in advance,

Keith