VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: JeremyAcy on May 18, 2015, 17:51:24 PM

Title: Adding trigger on "Ask a question" feature
Post by: JeremyAcy on May 18, 2015, 17:51:24 PM
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
Title: Re: Adding trigger on "Ask a question" feature
Post by: Milbo on May 20, 2015, 12:40:33 PM
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.
Title: Re: Adding trigger on "Ask a question" feature
Post by: JeremyAcy on May 21, 2015, 11:01:24 AM
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
Title: Re: Adding trigger on "Ask a question" feature
Post by: Milbo on May 22, 2015, 12:05:35 PM
yeh in skype I can easier sent you my patches
Title: Re: Adding trigger on "Ask a question" feature
Post by: Milbo on May 22, 2015, 12:44:11 PM
My idea for the moment


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

Title: Re: Adding trigger on "Ask a question" feature
Post by: guybr on June 10, 2015, 23:15:28 PM
Hi, is that all the code we need for this to work?
Title: Re: Adding trigger on "Ask a question" feature
Post by: Milbo on June 11, 2015, 23:26:13 PM
Use this version here http://dev.virtuemart.net/projects/virtuemart/files vm3.0.9.4
Title: Re: Adding trigger on "Ask a question" feature
Post by: guybr on June 12, 2015, 09:39:55 AM
To be more specific in my question, is the new code just on productdetails.php?
Title: Re: Adding trigger on "Ask a question" feature
Post by: Milbo on June 12, 2015, 15:38:53 PM
Quote from: Milbo on May 20, 2015, 12:40:33 PM
the trigger at line 150 controllers/productdetails.php function mailAskquestion
Title: Re: Adding trigger on "Ask a question" feature
Post by: guybr on June 14, 2015, 11:20:40 AM
...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"...