Author Topic: Add plgVmOnProductSave hook  (Read 606 times)

zanardi

  • Contributing Developer
  • Full Member
  • *
  • Posts: 878
    • GiBiLogic
Add plgVmOnProductSave hook
« 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.
--
Francesco (zanardi)
http://extensions.gibilogic.com
@gibilogic on Twitter

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9969
  • 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: http://extensions.virtuemart.net/