Search code examples
javascriptphpprestashopsmarty

How can I access Configuration::get('PS_LAST_QTIES') at core.js?


at prestashop 1.7 how could I access Configuration::get('PS_LAST_QTIES') at core.js?

Thank you, Miguel Gibert


Solution

  • I've sorted it out by passing the variable through the ProductController.php

    at $this->ajaxRender(Tools::jsonEncode([

    I added: 'ps_last_qties' => Configuration::get('PS_LAST_QTIES')

    and then I received it at core.js: o.default.on("updatedProduct", function (e) {

    and was able to use it as e.ps_last_qties