andkozinski Posted December 12, 2013 Share Posted December 12, 2013 (edited) Hi everyone. I write a module that integrates my warehouse program with the prestashop ver. 1.6 I have a problem with showing progress bar in my conntent module: myModule.php class public function getContent() { if (Tools::isSubmit('checkProducts')) { $colection = new CollectionCore('MYRODUCT'); // products from my werhouse MYRODUCT-entity class $colection->getAll(); $this->smarty->assign('ALL_PRODUCTS', $colection->count()); $tmp = 0; while ($colection->current()) { $result = $this->checkProductChange($colection->current()->getFields()); if (!$result) { $tp = $colection->current()->getFields(); $prod = new MYRODUCT($tp['T_ID']); // create product from my werhouse $prod->addProduct(); // add my product to my prestashop } elseif ($result AND $result != "NOUPDATE") { $prod = new MYPRODUCT($colection->current()->getFields()['T_ID']); $prod->updateProduct($result); // update my product in prestashop } $colection->next(); $this->smarty->assign('PRODUCT', $tmp++); // assign current product } return $this->display(__FILE__, 'myModule.tpl'); } myModule tpl file: <progress value="{$PRODUCT}" max="{$ALL_PRODUCTS}">{$PRODUCT}</progress> but Progress does not show. Andrew thx 24inks.com Edited December 13, 2013 by andkozinski (see edit history) Link to comment Share on other sites More sharing options...
Orange35 Posted December 12, 2013 Share Posted December 12, 2013 em.. this is forum for prestashop 1.5. Maybe, create theme in another forum tree? Link to comment Share on other sites More sharing options...
andkozinski Posted December 12, 2013 Author Share Posted December 12, 2013 (edited) Thx . But the version in this case does not matter. 24inks.com Edited December 12, 2013 by andkozinski (see edit history) Link to comment Share on other sites More sharing options...
Orange35 Posted December 13, 2013 Share Posted December 13, 2013 do you see any content from your template at user end? Write at tpl file something like 'TEST. TEST. TEST' at the top. If you will not see it - check path to your tpl. And cache also can be a problem - clear it at your admin-end. Link to comment Share on other sites More sharing options...
andkozinski Posted December 13, 2013 Author Share Posted December 13, 2013 Yes my tpl file is goog. There is a lot more things. This is backoffice module and everything works fine except the progress bar. This module add and update products (around 5000 ps) from my bookkeeper program to my website shop and works great.There are so many products so I want to have a progress bar. I suspect that the problem is in saving variable to template varibles and after thet display it (red line code) . Im looking for another solution. 24inks.com Link to comment Share on other sites More sharing options...
Orange35 Posted December 13, 2013 Share Posted December 13, 2013 (edited) em... try to change: $smarty->assign('PRODUCT', $tmp++); => $this->smarty->assign('PRODUCT', $tmp++); Edited December 13, 2013 by Orange35 (see edit history) Link to comment Share on other sites More sharing options...
andkozinski Posted December 13, 2013 Author Share Posted December 13, 2013 (edited) thx. I changed and the same does not work.($this->smarty refer to Smarty_Data() object ) Another solution that I mean the seve varible $tmp dynamically e.g. using java script. Edited December 13, 2013 by andkozinski (see edit history) Link to comment Share on other sites More sharing options...
Orange35 Posted December 13, 2013 Share Posted December 13, 2013 yes, for dynamic changing of {$PRODUCT} at <progress you must use javascript (ajax request to your module for getting current value).But without js you must see appropriate value of {$PRODUCT} at user-end. Link to comment Share on other sites More sharing options...
Recommended Posts