News:

Looking for documentation? Take a look on our wiki

Main Menu

Adding trigger on "Ask a question" feature

Started by JeremyAcy, May 18, 2015, 17:51:24 PM

Previous topic - Next topic

JeremyAcy

Hello VirtueMart team,

I'm using Joomla 3.4.1 and VirtueMart 3.0.9.

I'm one of the AcyMailing developers, and one of our clients asked us if we could modify one of our plugins
so that it would automatically subscribe someone using your "Ask a question" feature, even in "guest" mode.

Would it be possible to add a trigger in the "mailAskquestion" function of the file components / com_virtuemart / controllers / productdetails.php (passing at least the email/userid of the user)?
Or in the "renderMail" function of the file components / com_virtuemart / helpers / shopfunctionsf.php (passing at least the email/userid of the user and the "$viewName")?


Thank you!
Jeremy

Milbo

Hello Jeremy.

Yes, we can do that. I suggest the trigger at line 150 controllers/productdetails.php function mailAskquestion


$type = 'system';
JPluginHelper::importPlugin ($type);
$dispatcher = JDispatcher::getInstance ();
$dispatcher->trigger ('plgVmOnAskQuestion', array($VendorEmail, $vars, 'productdetails'));


something like that. Please contact me in skype, thank you.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

JeremyAcy

Hi,

Thank you, that would be perfect  ;D
Adrien told me that you also contacted him by email, should I contact you by Skype anyway?

Jeremy

Milbo

yeh in skype I can easier sent you my patches
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Milbo

My idea for the moment


JPluginHelper::importPlugin ('system');
JPluginHelper::importPlugin ('vmextended');
JPluginHelper::importPlugin ('userfield');
$dispatcher = JDispatcher::getInstance ();
$dispatcher->trigger ('plgVmOnAskQuestion', array($VendorEmail, $vars, 'productdetails'));

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

guybr

Hi, is that all the code we need for this to work?

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

guybr

To be more specific in my question, is the new code just on productdetails.php?

Milbo

Quote from: Milbo on May 20, 2015, 12:40:33 PM
the trigger at line 150 controllers/productdetails.php function mailAskquestion
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

guybr

...I can't get it to work. Is this limited to VM 3 only?

Do I need the full acymailing plugin installed or is the free version enough? My email address doesn't get logged into the acymailing table of "users"...