Jump to content

How to create PROGRESS BAR in Backoffice


Recommended Posts

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 by andkozinski (see edit history)
Link to comment
Share on other sites

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

×
×
  • Create New...