Hello,
I want to fire some javascript when the view gets updated by ajax via javascript when you are in the product details view. I have it in my generic file but that does not fire each time the page gets updated. Where can I find this Ajax javascript, so I can put my code in that place to let it fire with an update.
Thanks.
components\com_virtuemart\assets\js\cvfind.js
Quote from: GJC Web Design on December 19, 2018, 14:13:27 PM
components\com_virtuemart\assets\js\cvfind.js
OK awesome, do you have an idea in how to do what I want without touching the core? Do I need to override? Or is there another way to add some code into the functionality?
I think you can simply over ride this js file in your template assets js folder -- maybe someone here remembers better?
although prob add to the code in the default template and trigger there
if(VmConfig::get ('jdynupdate', TRUE)){
/** GALT
* Notice for Template Developers!
* Templates must set a Virtuemart.container variable as it takes part in
* dynamic content update.
* This variable points to a topmost element that holds other content.
*/
$j = "Virtuemart.container = jQuery('.productdetails-view');
Virtuemart.containerSelector = '.productdetails-view';
//Virtuemart.recalculate = true; //Activate this line to recalculate your product after ajax
";
vmJsApi::addJScript('ajaxContent',$j);
Quote from: GJC Web Design on December 19, 2018, 16:04:20 PM
I think you can simply over ride this js file in your template assets js folder -- maybe someone here remembers better?
although prob add to the code in the default template and trigger there
if(VmConfig::get ('jdynupdate', TRUE)){
/** GALT
* Notice for Template Developers!
* Templates must set a Virtuemart.container variable as it takes part in
* dynamic content update.
* This variable points to a topmost element that holds other content.
*/
$j = "Virtuemart.container = jQuery('.productdetails-view');
Virtuemart.containerSelector = '.productdetails-view';
//Virtuemart.recalculate = true; //Activate this line to recalculate your product after ajax
";
vmJsApi::addJScript('ajaxContent',$j);
Thanks, i tried this also, but because the page got reloaded it din't have use for my case.
So I added the javascript code to the template product details page and the start of the product container, now it gets fired everytime the new product gets loaded.