VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: zanardi on November 27, 2014, 12:57:28 PM

Title: Add plgVmOnProductSave hook
Post by: zanardi on November 27, 2014, 12:57:28 PM
Hello,
for several of my project I found that a "plgVmOnProductSave" hook would be really useful, to add custom checks / transformation. Some simple examples:

* I want to make the category MANDATORY, and abort the save if not set
* I want to produce a custom alias which is based on other data than the name

So I had to hack core files and re-apply after any update. Would it be possible to add just a few lines in /admin/models/product.php, method "store", just before the line:

    $stored = $product_data->bindChecknStore ($data, false);

If you were on GitHub I would issue a PR myself :-)
Seriously, if there's a better way to propose the change let me know.
Title: Re: Add plgVmOnProductSave hook
Post by: Milbo on November 27, 2014, 20:23:55 PM
create a patch of the svn and send it here or via skype (you have my contact)