Jump to content

Mass Update Module


dtbaker
 Share

Recommended Posts

Thank you very much for this great MOD. I am running massupdate 1.6 on Prestashop 1.4.7.3. I have, what I feel, is a simple and somewhat stupid question. Are you supposed to be able to load and run the /modules/massupdate/AdminMassUpdate.php.

 

 

If so, I am getting the following errors....

 

 

Warning: include_once(PS_ADMIN_DIR/../classes/AdminTab.php) [function.include-once]: failed to open stream: No such file or directory in/home/content/94/7639894/html/modules/massupdate/AdminMassUpdate.php on line 17

 

Warning: include_once() [function.include]: Failed opening 'PS_ADMIN_DIR/../classes/AdminTab.php' for inclusion (include_path='.:/usr/local/php5/lib/php') in/home/content/94/7639894/html/modules/massupdate/AdminMassUpdate.php on line 17

 

Fatal error: Class 'AdminTab' not found in /home/content/94/7639894/html/modules/massupdate/AdminMassUpdate.php on line 19

Share this post


Link to post
Share on other sites

Not sure what you mean by load and run the php file, you install as a module in the back office modules section.

Just click on modules, then upload a module from my computer and browse to where you saved the zip file and upload that.

Then go to administration area under modules find the Mass Update 1.6 and install

Then you can update products using the Mass update link under the Categories tab.

Share this post


Link to post
Share on other sites

Yeah I did all that and it works like it should...I think. But before installing it i was reading the posts and it talked about being able to choose what fields you displayed, and being able to edit some of the features. I just wanted to make sure that I was not missing a place to edit these options.

 

 

Thanks for getting back to me.

Share this post


Link to post
Share on other sites

  • 4 weeks later...

fantastic module, thank you very much :)

i've managed to make changes to the code with the very clear instructions

also.. I managed to download the old version and spend ages looking for the admin file that wasn't there before I realised there was a new version... :rolleyes:

Share this post


Link to post
Share on other sites

rebirth & TheWayside:

 

Did you install the 1.6 version from post 394 as this is the latest version of this module.

I just downloaded and installed on a 1.4.7.0 version without any issues.

I downloaded the one posted in post 394 just to make sure there was not an issue with the file.

Share this post


Link to post
Share on other sites

Have you tried to install using the upload a module from my computer, select the zip you downloaded and click on upload, go to administration and install, this is how I did it and had no issues.

 

And I agree you would think.

Share this post


Link to post
Share on other sites

Yes I tried that too, but it just says The following module(s) were not installed successfully:

And that is after I deleted it from the ftp. I was able to install the version on page 1, but when I pressed configure nothing happened either so I wanted to try the new version. Thanks for the reply, but still need it to work other wise I'm going to have to do it the slow way!

Share this post


Link to post
Share on other sites

If Configure button gives "tab not found" message, try pressing the Delete button for the massupdate module and then reinstalling by using the "add module from your computer" option. I just had the "tab not found" message and this procedure fixed the problem.

Share this post


Link to post
Share on other sites

when used in PS 1.5.0.17 both the mass price module and mass update module change the price in the -base price- . But in the front office prices are not changing. In fact the -base price- under catalog > products has no effect on the final prices whatsoever ??

anyone got ideas? adjusting ther module? and what is the -base price- ?

Share this post


Link to post
Share on other sites

nobody knows a way to sort products by name and not by ID?

With massupdate v1.6, in module AdminMassUpdate.php, around line 97, find this:

  // all products
  $sql = 'SELECT *
FROM `'._DB_PREFIX_.'product` p
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product`) WHERE pl.`id_lang` = '.$this->_id_lang;

Replace that SELECT statement with one that includes an ORDER BY clause:

  // all products
  $sql = 'SELECT *
FROM `'._DB_PREFIX_.'product` p
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product`) WHERE pl.`id_lang` = '.$this->_id_lang.'
ORDER BY pl.`name`';

This works for us with English language. I don't know if there are any problems with other languages.

  • Like 1

Share this post


Link to post
Share on other sites

when used in PS 1.5.0.17 both the mass price module and mass update module change the price in the -base price- . But in the front office prices are not changing. In fact the -base price- under catalog > products has no effect on the final prices whatsoever ??

anyone got ideas? adjusting ther module? and what is the -base price- ?

 

The module has not been updated to work with 1.5 will try myself when all testing on a good working 1.5 is available.

Right now I have so many issues with 1.5 just don't have the time to tackle this.

Share this post


Link to post
Share on other sites

With massupdate v1.6, in module AdminMassUpdate.php, around line 97, find this:

  // all products
  $sql = 'SELECT *
FROM `'._DB_PREFIX_.'product` p
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product`) WHERE pl.`id_lang` = '.$this->_id_lang;

Replace that SELECT statement with one that includes an ORDER BY clause:

  // all products
  $sql = 'SELECT *
FROM `'._DB_PREFIX_.'product` p
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product`) WHERE pl.`id_lang` = '.$this->_id_lang.'
ORDER BY pl.`name`';

This works for us with English language. I don't know if there are any problems with other languages.

 

This mod works great on PS 1.4.8.2 and Mass Update 1.6 in italian language!!!!

TY very much!!!!!!!!!!!!!! :wub:

Share this post


Link to post
Share on other sites

  • 2 weeks later...

Hello,

 

Wanted to thank for this wonderful module!

 

I have just one question: there's one product listed that is not in my shop - "Shure SE210 Sound-Isolating Earphones for iPod and iPhone". It's the default example of a product when installing a fresh copy of prestashop, but i've deleted it ages ago, yet it may be seen in the list. Any suggestions how to get rid of it?

Share this post


Link to post
Share on other sites

Hi TDR170, i have found a problem:

I have set the module to show 1000 products, when i change quantity or price and click on save all my product the message is: Your products have been successfully updated!

But this message is not real!!!!

The module change price and quantity only for the first 100 product (approximately)!

Any suggestions?

 

 

EDIT: i'm sure, the module change only the first 150 products!

 

EDIT 2: if i set page limit to 150 products all works great, but if i set page limit to 151 the product #151 dont change! same for all pages.

Edited by PEPPE83 (see edit history)

Share this post


Link to post
Share on other sites

Hi,

 

I have problems when installing this module. May it be because I'm working on a local server?

 

Once installed, both with the module installer or manually, nothing shows in the modules list :S

Share this post


Link to post
Share on other sites

Hi TDR170, i have found a problem:

I have set the module to show 1000 products, when i change quantity or price and click on save all my product the message is: Your products have been successfully updated!

But this message is not real!!!!

The module change price and quantity only for the first 100 product (approximately)!

Any suggestions?

 

 

EDIT: i'm sure, the module change only the first 150 products!

 

EDIT 2: if i set page limit to 150 products all works great, but if i set page limit to 151 the product #151 dont change! same for all pages.

 

Peppe83:

 

I have heard of this issue before , however I have never been able to reproduce as in my shops it has always worked fine, I updated quantities for 800 products without any issues. I just updated the quantity and weight for product #801 without any problems. Have you tried to uninstall and re-install, have you made any personnel mods to the code, what version of Presta.

Share this post


Link to post
Share on other sites

  • 1 month later...
  • 3 weeks later...

hi

i installed this module in both host & local and it working correctly (1.4.9)

and also i solved its problem with features

 

How about posting what your fix was so that others can benifit from your knowledge.

 

Hi there!

I am using prestashop 1.4.9, I installed the module without problems but when I try to load the tab nothing appears. Making it work would end my headaches with stock ^^

 

Edit:

 

Screenshot: http://imgur.com/u5Xmu

 

 

Have you tried to uninstall and re-install the module.

Share this post


Link to post
Share on other sites

  • 2 months later...

Thank you very much for this great MOD. I am running massupdate 1.6 on Prestashop 1.4.7.3. I have, what I feel, is a simple and somewhat stupid question. Are you supposed to be able to load and run the /modules/massupdate/AdminMassUpdate.php.

 

 

If so, I am getting the following errors....

 

 

Warning: include_once(PS_ADMIN_DIR/../classes/AdminTab.php) [function.include-once]: failed to open stream: No such file or directory in/home/content/94/7639894/html/modules/massupdate/AdminMassUpdate.php on line 17

 

Warning: include_once() [function.include]: Failed opening 'PS_ADMIN_DIR/../classes/AdminTab.php' for inclusion (include_path='.:/usr/local/php5/lib/php') in/home/content/94/7639894/html/modules/massupdate/AdminMassUpdate.php on line 17

 

Fatal error: Class 'AdminTab' not found in /home/content/94/7639894/html/modules/massupdate/AdminMassUpdate.php on line 19

 

 

Sir,

 

I got also an issue :(

 

PS 1.4.9 and MU V1.6. I installed it the proper way by uploading the zip via gui as I always do... But this module gives me the error:

Warning: Invalid argument supplied for foreach() in /usr/www/users ....
[b]/modules/massupdate/AdminMassUpdate.php[/b] on line [b]203[/b]

Edited by B.Köring (see edit history)

Share this post


Link to post
Share on other sites

Sir,

 

I got also an issue :(

 

PS 1.4.9 and MU V1.6. I installed it the proper way by uploading the zip via gui as I always do... But this module gives me the error:

Warning: Invalid argument supplied for foreach() in /usr/www/users ....
[b]/modules/massupdate/AdminMassUpdate.php[/b] on line [b]203[/b]

 

Use add a module from my computer in the BO modules section, browse to the location of the module on your computer, upload then install.

Share this post


Link to post
Share on other sites

Use add a module from my computer in the BO modules section, browse to the location of the module on your computer, upload then install.

 

Ezm, that's excactly what I did.

Y3zo.png

 

Y3zX.png

Share this post


Link to post
Share on other sites

This is a total pain but I was asked to modify this module to show prices inclusive of TAX, after reading all 15 pages in this thread I noticed it's not been done... yay. I have it working but on a single fixed tax rate, I've made the code flexable so if you wanted to load the tax rate from the database and assign it to the value you can, however I'm working on 19% so adapt as needed. It's worth noting when you submit prices with TAX you must save WITHOUT tax, also it will not always update the mass update form when reloaded keeping the old price in place, I over come this by forcing a page reload after SQL has been updated.

 

massupdate.php fixes to have prices inclusive of tax (on fixed rate NOT per country)

 

 

REPLACE / COMMENT OUT TO KEEP ORIGINAL TAX PRICE:

---

#$product['price'] = $product['db_price']; // price hack

--

 

WITH | Note ps_round to keep 2 decimal places:

---

$product['price'] = Tools::ps_round($product['price'],2); #Round off TAX price to 2 decimal places

----

This first give the actual form your price inclusive of TAX (whatever you TAX rate in use is)

 

 

REPLACE:

---

$this->_html .= $this->displayConfirmation($this->l('Your products have been successfully updated!'));

---

WITH:

---

$this->_html .= $this->displayConfirmation($this->l('Your products have been successfully updated!<hr><a href=\'?tab=AdminModules&configure=massupdate&token='.Tools::getAdminTokenLite('AdminModules').'&tab_module=Products&module_name=massupdate\'>Click here to continue</a>'));

 

return $this->_html; #SKIP OUT HERE

---

This stops the form from showing after you submitted changes and makes you click a link to continue, this forces a form reload including new price values (weird bug but whatever)

 

 

Now you form is showing prices including TAX and will do again properly after updating. So last is the actual update itself

 

you want to replace

----

if($update_value){

// we've found a main field to update!

$do_update = true;

$sql .= ", `".$field['db_field']."` = '$update_value' ";

}

----

 

With:

----

if($update_value){

 

if($field['db_field']=="price"){#IF price column then we need to remove BTW/TAX from input

$Oprice=Tools::ps_round(Product::getPriceStatic($product_id, true, NULL, 6),2); #Get original price WITH TAX/BTW

 

if($update_value!=$Oprice){# Only alter IF price has changed if NOT then do not update SQL field negating need to calculate each item

 

$NewPrice=($update_value/(100+$OurTAX))*100; #New price with TAX - (100%+TAX%) =1% without TAX * 100 = Full new price - TAX/BTW

#$NewPrice=Tools::ps_round($NewPrice,2);

 

#echo "<hr>Received ".$update_value." (Originally ".$Oprice.") inc TAX/BTW | Rate%: ".$OurTAX. " | Without TAX/BTW: ".$NewPrice. " + ".$OurTAX."% =

 

".Tools::ps_round(($NewPrice+(($NewPrice/100)*$OurTAX)),2)." (should match Received)"; #DEBUG OUT TEST

 

$do_update = true;

$update_value=$NewPrice;

$sql .= ", `".$field['db_field']."` = '$update_value' ";

 

} #No else, not needed. No change => No update

 

}else{ # Some other field value, let it run as normal

 

// we've found a main field to update!

$do_update = true;

$sql .= ", `".$field['db_field']."` = '$update_value' ";

 

}

 

}

----

 

 

First this statment checks if it's actually the price value being updated or not, if not continue as normal. If it is then:

 

Get the original price with tax and compare it again what was received, if it's the same then its not changed ignore it and don't update anything. IF it has changed:

 

Then take submitted amount and devide by 100% + $OurTAX (19). This gives 1% of the price WITHOUT tax.F

So then simply 1% value * 100 = Total price without TAX that needs updated in SQL :)

 

I declade $OurTAX outside the foreach statment, this way you can do a SQL call and get your TAX% automatically if yu wanted and just assign the value to $OurTAX for the rest to work, if your lazy then just declare $OurTAX=19; or whatever value before the foreach.

Does this work to work with prices "Tax included"?

I would agree that if I sell with tax included I have to be able to change prices Tax included.

Share this post


Link to post
Share on other sites

  • 2 weeks later...

Mh

 

I am so sad. I need this mass module more than ever and I can not get it working. Locally in XAMPP it does run issueless but installed on the live copy of the local Prestashop1.4.9 it does not!?

 

This time after cleanly deinstalling it first and then reinstalling:

 

10fZQ.png

 

10g0R.png

Share this post


Link to post
Share on other sites

  • 1 month later...

Hello and dear developer,

 

 

I could make out the trouble maker that impeded a successul use of your modul. I had debug mode on in my Prestashop config and since I turned that one off your module works and two other quirks I had are vanished, too.

Share this post


Link to post
Share on other sites

Hello and dear developer,

 

 

I could make out the trouble maker that impeded a successul use of your modul. I had debug mode on in my Prestashop config and since I turned that one off your module works and two other quirks I had are vanished, too.

I hope someone takes the code and make it compatible with 1.5.4. It's ridiculous to update 100 orders to ship everyday one by one

 

up

Share this post


Link to post
Share on other sites

Instead of this module you can use:

 

Mass price Update: http://www.prestashop.com/forums/topic/121053-modulemass-price-update-v16-ps-1215/

or

Order Edit, Category Edit, Product Edit: http://www.prestashop.com/forums/topic/185401-free-script-order-edit-category-edit-product-edit/

 

The latter has some mass update features in its product_edit program.

Share this post


Link to post
Share on other sites

  • photo-17453.jpg
  • Members
  • bullet_black.pngbullet_black.pngbullet_black.png
  • 618 posts

After I changed the data, it seems like the data could not be saved.....

 

 

I do feel the same.. How can you people use it? My products setting use this option,

"Available quantities for current product and its combinations are based on stock in the warehouses."

Does it option affect to the result?

Share this post


Link to post
Share on other sites

  • photo-17453.jpg
  • Members
  • bullet_black.pngbullet_black.pngbullet_black.png
  • 618 posts

After I changed the data, it seems like the data could not be saved..... I do feel the same.. How can you people use it? My products setting use this option, "Available quantities for current product and its combinations are based on stock in the warehouses." Does it option affect to the result?

 

Really? What's your version?

Share this post


Link to post
Share on other sites

  • 1 month later...
  • 3 weeks later...

This is exactly what I need. Thank you very much........works on ver 1.4.4.0

 

The only problem i had with it .. it deleted any text after " character in the main titlie heading ...ended up changing " to the word inch to over come

Share this post


Link to post
Share on other sites

  • 1 month later...
  • 2 weeks later...
  • 1 month later...
  • 3 weeks later...
  • 3 weeks later...

Femo

 

you could look at demos of storecommander or prestashop store manager or the fabulous and free piece of code developed by Musicmaker I think is his name in this forum:

tripleedit

tripleedit is the script! not module called you  should have a look at.

Share this post


Link to post
Share on other sites

  • 3 months later...
  • 2 weeks later...

I am getting  error:  For massupdatev1.6, PrestaShop version: PrestaShop™ 1.4.0.17

 

Forbidden

You don't have permission to access /admin123/index.php on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
 
]

 

I have change permission to 777 for both 'Admin folder' and 'Index.php' page, but no result.

 

Where I have to change the permission?

Edited by wdld (see edit history)

Share this post


Link to post
Share on other sites

  • 3 weeks later...
  • 1 month later...
  • 4 weeks later...

Hi I have installed version 1.6 of prestashop. and I installed the V1.6 of MassUpdate, I have the Spanish language so I tried changing $ this-> _id_lang = $ cookie-> id_lang; for $ this-> _id_lang = 1; as I had read in previous reviews and still does not work I just load a blank page anyone can help me I'm new to prestashop

Share this post


Link to post
Share on other sites

  • 2 weeks later...
  • 1 month later...

Sorry if my English is bad

 

I try to combine original code with julia's code and adding some new code. It work at Prestashop 1.6.0.9.

But still has a bug like if you want to zero-ing  qty, it not changed at all =__=".

 

 

============

Edited:

  • Product Weight, Product height, Product Width, and Product Depth changed into Shipping Weight, Shipping Height, Shipping Width, and Shipping Depth
  • Use massupdate.php to update your module
  • Where can i download this module? See the attachment :D 

============

massupdate.php

massupdate.zip

Edited by catochan (see edit history)
  • Like 2

Share this post


Link to post
Share on other sites

@G.Solidarite: Je vous en prie  :)

 

 

i have found how to zero the value... just input 0.00 to make zero (OMG just that? LoL)

i make little update for massupdate.php (see the attachment to download)

 

=====================

Edit 23 Sept 2014:

  • Now the product link can go directly to product, if there is INVALID SECURITY TOKEN just click I understand the risks and I really want to display this page

=====================

massupdate.php

Edited by catochan (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

  • 3 months later...
  • 2 weeks later...
  • 3 months later...
  • 8 months later...

Good work! I have some minor fixes though.

Currency fix (shows default currency sign):

function getConfig(){    $currencies = Currency::getCurrencies();    $default_currency = Configuration::get('PS_CURRENCY_DEFAULT');    foreach ($currencies as $currency) {        if ($currency['id_currency'] == $default_currency)            $sign = $currency['sign'];    }    $weight_units = strtolower(Configuration::get('PS_WEIGHT_UNIT'));     $main_product_fields = array(         "price"=>array(             "db_field"=>"price",             "friendly"=>$this->l('Price'),             "prefix"=> '(' . $sign . ')',         ),         "weight"=>array(             "db_field"=>"weight",             "friendly"=>$this->l('Weight') . " ($weight_units)",         ),         "quantity"=>array(             "db_field"=>"quantity",             "friendly"=>$this->l('Quantity'),         ),         //add more, eg: quantity, here.     );     return $main_product_fields;}
Language fix (Note that it will still work for one language only):

At the very to of updateProducts() function:

$language_id = Configuration::get('PS_LANG_DEFAULT');
Do the same for getContent() function.

Then near the end of updateProducts() function remove the

$language_id = 1;
getContent() function:

There are 2 SQL statements in it. Look for:

fl.`id_lang` = 1
Change it to:

fl.`id_lang` = '.$language_id.'
Then in the second SQL statement look for:

pl.`id_lang` = 1
Change to:

pl.`id_lang` = '.$language_id.'
Then look for this line:

$all_products = Product::getProductsProperties(1,$all_products);
Change it to:

$all_products = Product::getProductsProperties($language_id,$all_products);
That should do it.

Also, if you have a lot of product attributes, table stretches too much, you can do this to fix this issue:

Look for <table cellspacing="0" cellpadding="0" class="table space" width="98%" align="center">

Select whole table (everything betweentags) and replace it with this code:

<table cellspacing="0" cellpadding="0" class="table space" width="98%" align="center">    <tbody>        <tr>            <?php $product_rowspan = sizeof($main_fields) + sizeof($feature_results) + 1; ?>            <th width="1%"><?= $this->l('Product');?></th>            <th colspan="2"><?= $this->l('Accessories');?></th>        </tr>            <?php foreach($all_products as $product){                $product['price'] = $product['db_price']; // price hack            ?>          <tr>            <td rowspan="<?=$product_rowspan?>" width="1%" valign="top" nowrap>                <a href="?tab=AdminCatalog&id;_product=<?=$product['id_product'];?>&updateproduct;&token;=<?=Tools::getAdminToken('AdminCatalog11');?>"><?=$product['name'];?></a>            </td>       </tr>       <? foreach($main_fields as $m=>$f){ ?>       <tr>           <td><?=$f['friendly']?> <?=$f['prefix'];?></td>           <td>               <input type="text" style="width: 90%;" value="<?=$product[$f['db_field']];?>" name="mup[<?=$product['id_product'];?>][<?=$f['db_field'];?>]"/><?=$f['suffix'];?>           </td>      </tr>       <? }      foreach($feature_results as $k=>$v){           // what value is in this feature?      $feature_value = '';      foreach($product['features'] as $f){          if($f['id_feature']==$v['id_feature']){           $feature_value = $f['value'];          }     }       ?>        <tr>           <td><?=$v['name']?></td>           <td>               <input type="text" style="width: 90%;" value="<?=$feature_value;?>" name="mup[<?=$product['id_product'];?>][ff][<?=$v['id_feature'];?>]"/>           </td>       </tr>        <?php         }     }        ?>         </tbody></table>
The last one will make your table longer (or higher, if you wish).

Please test this on your local machine first, I'm a human, so I might have forgotten something :)

 

 

I have done all these steps and still I see no products displayed. I am using PS 1.6.1.0 with language id 6.

 

What could I be doing wrong? The search function didn't help me here :(:unsure:

Share this post


Link to post
Share on other sites

  • 3 months later...

Nice script, thank you.

i try to add this:

			"unit_price_ratio"=>array(
	 			"db_field"=>"unit_price_ratio",
	 			"friendly"=>"Unit Price Ratio",
	 		),

but my Unit price ratio doesn't change.

 

How to do this? i work on PS 1.6.1.4

Share this post


Link to post
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More