The Products "Subpanel" on Quotes

I need to run a script when an item is Saved on the Quote.  So you pick a product from the dashlet, it is added to the SubPanel and then you click on the green button to save it.

As it is saved I need to check its 'product_template_id' and if it is one of 4 I need to set a checkbox on the parent quote.  If its not one of the 4 I am looking for then nothing happens.

Right now I have a timer that runs once a second and looks that way, its horrible but it works but I cant really see myself putting this in Production.  Does anyone know where I can attach a script to that save button and check there?

Parents Reply Children
  • Do you need to have this feature in place only on creating/editing a Quote or anytime? I mean, to look for that field on Product Templates only on managing a Quote or anythime the related Product Template is modified anyhow?

    For the first scenario you really need to copy the field from Product Templates to Products (via populate_fields on product_template_name field at Products module). Then you have to create a field on Product Bundles which will somehow rollup that field from Products and finaly to create a field on Quotes which will be a rollup from that field from Product Bundles, according to value from that field you can update your target field.

    For the second scenario a Scheduled Job certainly can do the job.

    Regards

    André Lopes
    Lampada Global
    Skype: andre.lampada