Author Topic: Add plgVmOnProductSave hook  (Read 651 times)


  • Contributing Developer
  • Full Member
  • *
  • Posts: 878
    • GiBiLogic
Add plgVmOnProductSave hook
« on: November 27, 2014, 12:57:28 pm »
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)
@gibilogic on Twitter


  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10040
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Add plgVmOnProductSave hook
« Reply #1 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)
I should fix your bug, please support the VirtueMart project and become a member
Extensions approved by the core team: