Jump to content

Update all products discount at once


Recommended Posts

I forgot that I customised the module. Change the $main_product_fields definition in the getConfig() function on line 55 of massupdate.php to:

$main_product_fields = array(
   "price"=>array(
       "db_field"=>"price",
       "friendly"=>"Price",
       "prefix"=>'$',
   ),
   "reduction_price"=>array(
       "db_field"=>"reduction_price",
       "friendly"=>"Reduction price",
   ), 
   "reduction_percent"=>array(
       "db_field"=>"reduction_percent",
       "friendly"=>"Reduction percentage",
   ), 
   "weight"=>array(
       "db_field"=>"weight",
       "friendly"=>"Weight ($weight_units)",
   ),
   "quantity"=>array(
       "db_field"=>"quantity",
       "friendly"=>"Quantity",
   ),
   //add more, eg: quantity, here.
);



This will display price, reduction_price, reduction_percent, weight and quantity columns.

Link to comment
Share on other sites

I remember I had to make some modifications to the module before I could get it to work on the munum website. I've attached my updated module in case it helps. If it doesn't, you'll need to read through the mass update module thread. Others have encountered the same error and might have posted a solution.

massupdate.zip

Link to comment
Share on other sites

Rocky how much would you charge to fix your example of the mass update module? I have all the examples of this module installed and none of them work past 100 products or so. Its a very strange issue indeed because it does work to a point.

Heck I would even but this module if it really works for price, weight & quantity
http://www.prestastore.com/bulk-update/188-presta-quickupdate.html

Link to comment
Share on other sites

Is it a PHP timeout issue or an error message in the module itself? Have you tried increasing your PHP maximum execution time and memory limit?


No errors, no timeouts, no nothing.

I have 398 products and the module says after I edit price and or add weight after 100 or so products...

----
Your products have been successfully updated!
----

Well well you don't say??? It never updates nothing.

I have increased the memory on my server. As far as execution time I haven't tweaked that yet. Any ideas on what to set them both?

CENTOS 5.4 i686
Apache version 2.2.15
PHP version 5.2.13
MySQL version 5.0.90-community-log
Guaranteed RAM 1.5 GB
Burst RAM 3 GB

I know when I hit (Save all my products) that my server does even break a sweat.

What debug could I use and where should it be placed?

Thanks for your time man.
Link to comment
Share on other sites

I didn't write the module, so I don't know a lot about the code, but from a quick look at the code, it appears that it is the updateProducts() function that reads each row that was entered then does a separate UPDATE query for each row. I suggest that you check that the rows are being correctly read and that the UPDATE query isn't failing. You can try printing out the UPDATE query and running it manually using phpMyAdmin to see whether there is an error or whether it says "0 rows updated".

Link to comment
Share on other sites

  • 2 years later...

I didn't write the module, so I don't know a lot about the code, but from a quick look at the code, it appears that it is the updateProducts() function that reads each row that was entered then does a separate UPDATE query for each row. I suggest that you check that the rows are being correctly read and that the UPDATE query isn't failing. You can try printing out the UPDATE query and running it manually using phpMyAdmin to see whether there is an error or whether it says "0 rows updated".

 

Hi Rocky,

 

I have used it, but still only field "Weight" that been updated, not the "Quantity". I have tried your suggestion, echo UPDATE query and copas it, execute from background, and it successfully executed (1 rows updated). But still, quantity doesn't change.

Can you help me?

 

Thanks so much,

Frans YA

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...