Jump to content

Welcome, Guest!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

musicmaster

Prestools - the mass edit toolset

Recommended Posts

@musicmaster said in Prestools - the mass edit toolset:

Of course Prestools has quite a lot of different functions and it depends what you want to do. But in general it is not possible.

I would like to set up some automatic mass edits once or twice a week adding features from a product name search.

I don't want to do it by a plain sql query because I'm afraid to mess up with the DB...

prestools do that with an plain sql query?

Share this post


Link to post
Share on other sites

@foolab said in Prestools - the mass edit toolset:

I don't want to do it by a plain sql query because I'm afraid to mess up with the DB...

prestools do that with an plain sql query?

It would help if you could give a more concrete example. I really don't understand what you with "adding features from a product name search". Features are quite complicated so it will take you some study if you want to do it yourself with sql queries. Of course in the end you always end up with sql queries and if you turn verbose on you can see exactly which ones Prestools uses.

Share this post


Link to post
Share on other sites

I have a list of product with very long names. In the product names there are features values (color, year, country)

Product Name Germany Black 1963

With prestools I can search for the value in the name and modify/add the "true" features value.

Share this post


Link to post
Share on other sites

I think the more effort you put in it the better it goes: - adding a feature is basically just one sql line like: INSERT INTO psfeatureproduct SET idproduct='113',idfeature='18',idfeaturevalue='810' - the point is of course that you need to know the numbers. If you have a table that links "black" to feature "18" and feature_value "810" then it is simple. - the thing to watch for is conflicting values. If you try to assign the same color twice or a different color to something that already has a color assigned you will get an error. - with such a table and a bit of php you could achieve what you want.

Share this post


Link to post
Share on other sites

Hey @musicmaster, thanks for this excellent tool, but it almost gave me a heart attack! :facescreamingin_fear:

Why? Well I uploaded it and was eagerly testing away in a test site that's hosted in a sub-domain of the live site, when I suddenly noticed it was displaying the live site's favicon. Now, one of several measures I take to avoid accidentally editing the wrong site is to use very different favicons on both sites. So I had a moment of panic when I though I may have been wantonly editing products on my live site, but thankfully that wasn't the case.

I don't know how easy this would be to fix, but I would appreciate it if you could. Cheers!

Share this post


Link to post
Share on other sites

Hi Angstony, Prestools doesn't move favicons. And the fact that Prestools picks up the favicon of your main shop says nothing about which database Prestools is working on. It is just a function of your browser and server. You can easily check which database Prestools is working on by making some innocent change (like a minor text change) and looking in which shop it appears. There have in the past been some problems with two shops on the same server but these were fixed at that time. Just for your information the technical side: Prestools looks for your TB settings file in the config directory and it uses that to access the database. Almost all operations of Prestools access only the database. This looking for the settings file happens in the function connecttodatabase() in login1.php.

Share this post


Link to post
Share on other sites

Thanks for that, musicmaster. I realized it was editing the correct database shortly after my initial concern.

I've got it showing the correct favicon now. It turns out I'd made an incorrect assumption about the way TB handles favicons: I thought that having set the alternative icon in the back office it would replace the file in the installation's root folder, but no, upon examination of the source code I see BO's favicon is picked up from the /img/ folder.

Sorry to have troubled you, and thanks again for your detailed response.

Share this post


Link to post
Share on other sites

where do I download the .zip file?
(The thread on Prestashop has an error message next to the link, and the Prestools site points to the Prestashop thread)

Share this post


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

where do I download the .zip file?
(The thread on Prestashop has an error message next to the link, and the Prestools site points to the Prestashop thread)

I don't see an error on the PS site. But you can also download from the first post of this thread (first paragraph, word "here"). And you can also scroll down on the homepage of Prestools.

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

×