VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: d0ublezer0 on August 28, 2017, 11:28:19 AM

Title: Convead - how about "no hacking"?
Post by: d0ublezer0 on August 28, 2017, 11:28:19 AM
i use convead service  (https://convead.com/)on my site.
there is instruction how to install plugin:
Quote
    If you run your store under VirtueMart, you have to make some additional changes in store's source code.:

    Open components/com_virtuemart/helpers/cart.php file.
    Find function public function add(...) {...}
    Insert the following code at the bottom of the function before if ($updateSession== false) return false; line:

/* Convead hack */
JPluginHelper::importPlugin('vmcustom');
$dispatcher = JEventDispatcher::getInstance();
$dispatcher->trigger('plgVmOnAddToCart',array($this));
/* End Convead hack */
how to do this without core hack?
Title: Re: Convead - how about "no hacking"?
Post by: Ghost on August 28, 2017, 11:34:18 AM
Update VM.
Title: Re: Convead - how about "no hacking"?
Post by: d0ublezer0 on August 28, 2017, 11:45:09 AM
Quote from: Ghost on August 28, 2017, 11:34:18 AM
Update VM.
Haha, And after update, i lose this hack. ((
The question was, how to do the same, but without the hack? Is it possible? It's hard to remember always where the non-standard approach is used.
Title: Re: Convead - how about "no hacking"?
Post by: Ghost on August 28, 2017, 12:04:54 PM
No, really, update VM. This was just added in 3.2.4.

http://virtuemart.net/news/latest-news/481-virtuemart-3-2-4-released-with-new-payment-options

QuoteNew triggers increase the flexibility of VirtueMart. The triggers plgVmBeforeStoreProduct and plgVmAfterStoreProduct in the product model allows automatically set product properties. The triggers plgVmOnUpdateCart (in cart controller) and plgVmOnAddToCart (in cart helper function add) give programmers more control when a user is adding an item to the cart.
Title: Re: Convead - how about "no hacking"?
Post by: Milbo on August 28, 2017, 20:32:53 PM
That is nice, they saw that I added it in the svn and already used it and gave their users so long the advice how to add it.
Title: Re: Convead - how about "no hacking"?
Post by: Ghost on August 29, 2017, 08:08:14 AM
To be fair, they've been using this hack for 2 years now https://github.com/Convead/joomla_convead/blob/master/README.md.
Title: Re: Convead - how about "no hacking"?
Post by: Milbo on August 29, 2017, 08:20:02 AM
hohoo, even more fun. I had no clue about. I just added it with the same name, luck, or?
Title: Re: Convead - how about "no hacking"?
Post by: Ghost on August 29, 2017, 08:23:55 AM
Or sensible naming convention.