Jump to content
musicmaster

FREE script - Prestools-Suite mass edit order - Edit and much more

Recommended Posts

1 minute ago, musicmaster said:

 

What Prestools version do you have? It works only with the last two releases.

Prestools version 1.24m. Release date: 20-feb-2020.

Share this post


Link to post
Share on other sites
Posted (edited)

There are still two problems that I hope to repair with a new version tomorrow. Maybe you experience them:

 - you cannot add an image to a product that doesn't have images.

 - in some circumstances you can end with a product where none of the images are marked as "cover". The result is that you won't see an image in the backoffice products list.

Edited by musicmaster (see edit history)

Share this post


Link to post
Share on other sites
Posted (edited)

I uploaded a new Prestools version: 1.24n. It contains a new version of the image plugin too. 

The new version fixes a few issues with image edit:

 - you could not add an image to a product that didn't have any images.

 - when you marked a newly added image as cover it wasn't registered as such. As a consequence the product ended with no cover and you didn't see an image in the backoffice product list.

 - when you made the image field editable and the cover image was not the first one it displayed on the first position the cover image too.

The editing is now more wysiwig as it makes  that you to always have an active cover product.

If you find any more problems please let me know.

Edited by musicmaster (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

Hello,


Im getting this error with latest and previous version of module also... trying to change category name 😕

 

 

2246 Records - of which 1 submitted.
*****4: 
Notice: Undefined index: id_shop in ....../myprestools/cat-proc.php on line 101

MySQL error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
Generated by URL '...../myprestools/cat-proc.php'
with Query 'UPDATE ps_product_shop set indexed=0 WHERE id_category_default='5132' AND id_shop='

Share this post


Link to post
Share on other sites

Hello, I have been using this script for a long time, no problems whatsoever, but recently I tried to use the Image Cleanup and it gives me an error:

MySQL error 1146: Table 'delikate_prest58.psm9_PRESTOOLS_imgspace' doesn't exist
Generated by URL '/deladmin/d_mass/diskspace.php'
with Query 'SHOW COLUMNS FROM psm9_PRESTOOLS_imgspace WHERE field="path"'

Any idea what the problem is? I'm using prestools 1.24q with Prestashop version 1.6.1.23

Thank you for your hard work.

Cléon Adónis Santos

Share this post


Link to post
Share on other sites
21 hours ago, cleon said:

Hello, I have been using this script for a long time, no problems whatsoever, but recently I tried to use the Image Cleanup and it gives me an error:

MySQL error 1146: Table 'delikate_prest58.psm9_PRESTOOLS_imgspace' doesn't exist
Generated by URL '/deladmin/d_mass/diskspace.php'
with Query 'SHOW COLUMNS FROM psm9_PRESTOOLS_imgspace WHERE field="path"'

Any idea what the problem is? I'm using prestools 1.24q with Prestashop version 1.6.1.23

Thank you for your hard work.

Cléon Adónis Santos

Hi Cléon,

Can you try the attached file?

Regards,

M

diskspace.php

Share this post


Link to post
Share on other sites
13 minutes ago, musicmaster said:

Hi Cléon,

Can you try the attached file?

Regards,

M

diskspace.php 26.6 kB · 1 download

Hello,

Just replaced the file "diskspace.php" and the got the same error.

Thank you.

Share this post


Link to post
Share on other sites
1 hour ago, cleon said:

Hello,

Just replaced the file "diskspace.php" and the got the same error.

Thank you.

Very strange. The new version puts a check for the imgspace table before the line that produces the error. So this shouldn't happen.

Share this post


Link to post
Share on other sites
22 minutes ago, musicmaster said:

Very strange. The new version puts a check for the imgspace table before the line that produces the error. So this shouldn't happen.

Could the query be case sensitive? I've noticed that my table is "psm9_prestools_imgspace" and the error returns "psm9_PRESTOOLS_imgspace"?

I've double checked the file and the server has the new one:

806102798_Annotation2020-03-29170151.png.09c69103b9aab6cf8706c3c53288c521.png

564799457_Annotation2020-03-29170152.png.6a9fdadd14aa8d83d443e577d5d5972b.png

Share this post


Link to post
Share on other sites

Just some thoughts, could it be the prefix of the DB/table?

delikate_prest58.psm9_PRESTOOLS_imgspace' - VS - psm9_PRESTOOLS_imgspace? Thank you.

Share this post


Link to post
Share on other sites

Can you test for the case sensitive option?

In settings1.php there is a line

define('_PRESTOOLS_PREFIX_', 'PRESTOOLS_');

Could you change that to

define('_PRESTOOLS_PREFIX_', prestools_');

Share this post


Link to post
Share on other sites
On 3/29/2020 at 6:12 PM, cleon said:

Just some thoughts, could it be the prefix of the DB/table?

delikate_prest58.psm9_PRESTOOLS_imgspace' - VS - psm9_PRESTOOLS_imgspace? Thank you.

A pity that you didn't react to my previous post. I suspect the problem is one of those MariaDb-MySql differences but I cannot be sure without your feedback.

Share this post


Link to post
Share on other sites
On 3/29/2020 at 5:20 PM, musicmaster said:

Can you test for the case sensitive option?

In settings1.php there is a line

define('_PRESTOOLS_PREFIX_', 'PRESTOOLS_');

Could you change that to

define('_PRESTOOLS_PREFIX_', prestools_');

Sorry for my delay, busy days.

I've tried that with no results also. But I did try to change the name in the DB, and apparently it worked. It doesn't give any error as previous, it just stands there, until it appears this message:
 

504 Gateway Time-out

nginx

Haven't test it more, but I will do it later. Is this normal? Should I keep clicking until it list the images?

Thank you

Cléon

Share this post


Link to post
Share on other sites
27 minutes ago, cleon said:

504 Gateway Time-out nginx

That is server configuration stuff. Not related to Prestools.

Share this post


Link to post
Share on other sites

When I click "Gather unused product images" there's no error, and after some time it gives me that message. I know that this timeout is related to the server, and I can give a higher value.

Since there's no DB error as previous, can I assume that the problem is solved? I have around 20GB of images, what happens when it times out? What message or error should I expect before clicking again?

Thank you.

image.thumb.png.6ca34f2cd1dee7a501d52e8262678de4.png

image.png

Share this post


Link to post
Share on other sites

 

24 minutes ago, cleon said:

When I click "Gather unused product images" there's no error, and after some time it gives me that message. I know that this timeout is related to the server, and I can give a higher value.

Since there's no DB error as previous, can I assume that the problem is solved? I have around 20GB of images, what happens when it times out? What message or error should I expect before clicking again?

Gathering unused images is a time-consuming process. Prestools crawls the harddisk and then checks for every image  that it finds that it is also present in the database.

In your case that is a problem. You have lots of images and your server doesn't like task taking too long.

I am still not sure what the problem was that gave your prior error. So I can't say anything about that. I am glad it is solved. But from the technical point of view the question is still open.

It looks like Nginx is just cutting off the server. Not very nice but the database should be able to handle it. And Prestools uses its own tables so I consider it very unlikely that anything would be damaged. The main problem is that Prestools isn't built to handle this kind of situations. So the next time you start to gather you start again from image one and you are unlikely ever to reach the last image unless you change the timeout in the server settings.

 

 

Share this post


Link to post
Share on other sites

Hello, I tried to use copy_shopdata  script to transfer data from one shop to another, but after running the script I get an error:

oldconn = <old db host>.<dbuser> = 67917811
new conn = <new db host>.<dbuser> = 67917809
1 old languages: sk (1); 1 new languages: sk (1); Language check ok.
 

No language transformations needed.Initialization skipped because it had already run
Copying tables

1 accessory 724

MySQL error 1045: Access denied for user '<old db user>'@'%' (using password: YES)
Generated by URL '/adminXX/ptools/copy_shopdata.php'
with Query 'SELECT `id_product_1`,`id_product_2` INTO OUTFILE '/home/html/XXXXX/public_html/adminXX/ptools/copy_shopdata_accessory.dtx' FROM `shplive_accessory`'

 

What access is denied? Ptools tool works for me without any problems. Thanks.

Share this post


Link to post
Share on other sites
9 minutes ago, Juraj said:

Hello, I tried to use copy_shopdata  script to transfer data from one shop to another, but after running the script I get an error:

oldconn = <old db host>.<dbuser> = 67917811
new conn = <new db host>.<dbuser> = 67917809
1 old languages: sk (1); 1 new languages: sk (1); Language check ok.
 

No language transformations needed.Initialization skipped because it had already run
Copying tables

1 accessory 724

MySQL error 1045: Access denied for user '<old db user>'@'%' (using password: YES)
Generated by URL '/adminXX/ptools/copy_shopdata.php'
with Query 'SELECT `id_product_1`,`id_product_2` INTO OUTFILE '/home/html/XXXXX/public_html/adminXX/ptools/copy_shopdata_accessory.dtx' FROM `shplive_accessory`'

 

What access is denied? Ptools tool works for me without any problems. Thanks.

This is about the shop from which you copy the data and for which you entered the credentials in copy_shopdata_config.php. So check those credentials.

Share this post


Link to post
Share on other sites

Hello, I have just downloaded the latest version of the script. I want to set the low stock alerst to all products. Curently I have 0 value.

obraz.png.d16e80630ae6394636194334399e6455.png

When I select Edit on LowStockAlrt column the values change to tick box

obraz.png.5c804ddf48139c9c816b5e63e9977760.png

When I set value 1 on LowStockAlrt on Mass update field the PresTools script refresh the page and shows me the default view. No changes are made.

obraz.png.4c9da83208e5b9f203c947892203dd7b.png

 

Is there a way to set "1" value in that column in mass update mode? Updating values manually is possible but I have a lot of products.

Share this post


Link to post
Share on other sites
15 hours ago, banan_44 said:

Hello, I have just downloaded the latest version of the script. I want to set the low stock alerst to all products. Curently I have 0 value.

obraz.png.d16e80630ae6394636194334399e6455.png

When I select Edit on LowStockAlrt column the values change to tick box

obraz.png.5c804ddf48139c9c816b5e63e9977760.png

When I set value 1 on LowStockAlrt on Mass update field the PresTools script refresh the page and shows me the default view. No changes are made.

obraz.png.4c9da83208e5b9f203c947892203dd7b.png

 

Is there a way to set "1" value in that column in mass update mode? Updating values manually is possible but I have a lot of products.

Thank you for your error report.

Can you try the attached file? It should renamed product-edit6.js and replace the existing file.

 

product-edit6.txt

  • Like 1

Share this post


Link to post
Share on other sites

@musicmaster, thanks for fast reply. I copy copied the content of your TXT file a replaced the content of product-edit6.js on my server. I confirm the problem is solved. I was able to tick all checkboxes. Mass update was successful.

  • Like 1

Share this post


Link to post
Share on other sites
On 4/2/2020 at 8:33 PM, musicmaster said:

I am still not sure what the problem was that gave your prior error. So I can't say anything about that. I am glad it is solved. But from the technical point of view the question is still open.

Hello,

I'm back again and I have some time to test and try to solve the problem. I have undo my previous step, where I have manually changed the name of the table from lower case to upper case (apart from the timeout, it didn't do nothing). I'm using your file diskspace.php.

Doing that, I notice that the error is different. Initially it was error 1146, now it's 1064:

MySQL error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'psm9_PRESTOOLS_imgspace' at line 1
Generated by URL '/deladmin/d_mass/diskspace.php'
with Query 'show tables like psm9_PRESTOOLS_imgspace'

what else do you need from me? thank you.

Share this post


Link to post
Share on other sites

@musicmaster, updating prestools to version 1.24r, there's no more errors. Only nginx timeout, I will try to fix this and return to you if the problem is fixed.

Thank you.

  • Like 1

Share this post


Link to post
Share on other sites

@musicmaster I increased the max_execution_time and apparently it worked, but didn't finish (probably because of the large number of images I have). But what I have noticed is that when I press the gather unused product images, the PRESTOOLS_imgspace table, starts to increase and goes up to 200.000 rows, but no matter I select Restart collection or not, it always restart the process from 0. Shouldn't it continues from the last row? Thank you.

Share this post


Link to post
Share on other sites
16 hours ago, cleon said:

@musicmaster I increased the max_execution_time and apparently it worked, but didn't finish (probably because of the large number of images I have). But what I have noticed is that when I press the gather unused product images, the PRESTOOLS_imgspace table, starts to increase and goes up to 200.000 rows, but no matter I select Restart collection or not, it always restart the process from 0. Shouldn't it continues from the last row? Thank you.

It was probably my fault (more than one click). I just bought the "delete images" plugin and it looks that is working ok.

Thank you for your support!

Share this post


Link to post
Share on other sites
7 hours ago, cleon said:

It was probably my fault (more than one click). I just bought the "delete images" plugin and it looks that is working ok.

Thank you for your support!

Actually you may have had a point. To look for where it ended last time the system now looks for the highest id_image. But the script is spidering the disk in a different way. After it starts with the "1" it goes into its tree: "11", "123", etc. Only when it has completed this tree it goes to the "2" and its tree. But if it stopped after handling "55" "123" might still be the highest number. So it would do all of "2", "3", "4" and "5" again.

Share this post


Link to post
Share on other sites
On 4/6/2020 at 6:39 PM, cleon said:

@musicmaster I increased the max_execution_time and apparently it worked, but didn't finish (probably because of the large number of images I have). But what I have noticed is that when I press the gather unused product images, the PRESTOOLS_imgspace table, starts to increase and goes up to 200.000 rows, but no matter I select Restart collection or not, it always restart the process from 0. Shouldn't it continues from the last row? Thank you.

Fixed in version 1.24s.

Share this post


Link to post
Share on other sites

Just wanted to say, once again, thankyou.

I was messing around the other day with groups and thought I would create one while trying to do discounts etc.

When I logged in to my shop as a customer, I realised it showed no products.  I started investigating and found that I needed to set all the categories to accept the new group.

I did a little search and all sorts of scripts and sql as they is no natural way to assign all categories to groups.  I didn't want to edit 300 + categories manually, or play with sql.

Then it dawned on me that Prestools MIGHT handle this, so I did a little delving and it it does.

Around 30 seconds later 300 categories had the new group added.

Just now I discovered that I needed to stop visibility on around 30 products.  Bish bash bosh, done in 10 seconds.

It's the best money I have ever spent in relation to Prestashop.!!

  • Like 2

Share this post


Link to post
Share on other sites

Version 1.26 offers multi-language editing.

If you have more than one language you will see all other languages than the selected languages on the third row as extra languages that you can select:

extra1.jpg.d08478ab5479c9d6840af3ee00aa4a92.jpg

If you do so all language sensitive fields will appear in versions for all the selected languages. The main language will be have its usual names. For the others names will have a suffix with the isocode of the language:

extra2.jpg.b7043755bf5267dc9756f9729e97fab2.jpg

Share this post


Link to post
Share on other sites

Hi, I have been using prestools without problem until today I got this error;

No access allowed for IP addresses: Array ([0] => 'my IP')
You may not use this script from IP Adress: 'my IP'

What could have happened?
Is there a way to fix it?

Thanks!

Share this post


Link to post
Share on other sites
15 minutes ago, oncle said:

Hi, I have been using prestools without problem until today I got this error;

No access allowed for IP addresses: Array ([0] => 'my IP')
You may not use this script from IP Adress: 'my IP'

What could have happened?
Is there a way to fix it?

Thanks!

Is your ip address still correct? Some providers occasionally change it - for example when your router reboots.

You can always make the ip array empty and the remove the filter. But it should work.

 

  • Like 1

Share this post


Link to post
Share on other sites

Perfect musicmaster, the IP had been modified. I have changed it in settings1.php and it already works.
Thanks for the quick reply.

Share this post


Link to post
Share on other sites
Posted (edited)

Hey, 

I have the newest one prestools, and prestashop 1.7.6.4 . When I export to CSV I have in ID column something like:

 

<br />
<b>Notice</b>:  Undefined offset: 1358 in <b>/home/.............../prestools/product-csv.php</b> on line <b>795</b><br />
<br />
<b>Notice</b>:  Undefined offset: 0 in <b>/home/.............../prestools/product-csv.php</b> on line <b>800</b><br />

 

Something simmilar is in category column, how to fix this ? 

 

Thanks

Edited by conderus (see edit history)

Share this post


Link to post
Share on other sites

I have no idea what this is. I cannot reproduce it in a fresh PS installation.

So my guess would be that there is something unusual in the database that causes this. To determine what I would need to have access.

If you want to look yourself, here is something to look for:

 - in line 800 it sees a value 0 for id_category in the ps_category_product table. There is no category with such an id. So that would be a faulty value in the database.

 - similarly it sees an id_category of 1358 in the error on line 795. You should check whether there is a category with such an id.

Share this post


Link to post
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...

Important Information

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