News:

Support the VirtueMart project and become a member

Main Menu

Add plgVmOnProductSave hook

Started by zanardi, November 27, 2014, 12:57:28 PM

Previous topic - Next topic

zanardi

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.
--
Francesco (zanardi)
http://extensions.gibilogic.com
@gibilogic on Twitter

Milbo

create a patch of the svn and send it here or via skype (you have my contact)
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/