VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: EvanGR on December 30, 2021, 08:24:02 AM

Title: Save a value in the Database? (from within the template)
Post by: EvanGR on December 30, 2021, 08:24:02 AM
Hello,

Is it possible to save a value in the database, from a template?
Reason: I want to store some custom analytics data in a custom table, on every page load.

Thanks
Title: Re: Save a value in the Database? (from within the template)
Post by: Studio 42 on December 30, 2021, 14:48:57 PM
You can use a Joomla system plugin for this case
Check if you are in admin or not, if you only want Virtuemart pages ... and save in a table you create what you need(iP, URL, GET or POST parameters....)
Title: Re: Save a value in the Database? (from within the template)
Post by: EvanGR on December 31, 2021, 13:10:48 PM
Based on your response, I managed to do it via the standard Joomla API. Thank you!