Jump to content
musicmaster

[Free Script] Prestools Suite: Mass Edit, Order Edit And Much More

Recommended Posts

Hi,

 

   I get the following error when trying to 'add product' in 'edit order'.

Notice: Undefined index: id_tax in /home/xxx/xxxx/store/admin-xxx/triple_edit/order-edit.php on line 121
MySQL error 1054: Unknown column 'pl.name' in 'field list'
Generated by URL '/store/admin-xxx/triple_edit/order-edit.php'
with Query 'select p.weight,p.ean13,p.upc,p.reference,p.supplier_reference,p.quantity, ps.*,pl.name,pl.id_lang,l.iso_code,t.rate as tax_rate,t.id_tax, tl.name as tax_name from ps_product_shop ps left join ps_product p on p.id_product=ps.id_product left join ps_lang l on pl.id_lang=l.id_lang left join ps_tax_rule tr on tr.id_tax_rules_group=ps.id_tax_rules_group AND tr.id_country='21' AND tr.id_state='0' left join ps_tax t on t.id_tax=tr.id_tax left join ps_tax_lang tl on t.id_tax=tl.id_tax AND tl.id_lang='1' WHERE ps.id_shop='1' AND ps.id_product='176' '

  I am using prestashop 1.5.6.2

 

  Thanks for any help!

Share this post


Link to post
Share on other sites

@thejackal

Did you change the source code?

 

The query should look like

 $query="select ".$fields." from ". _DB_PREFIX_."product_shop ps";
 $query.=" left join ". _DB_PREFIX_."product p on p.id_product=ps.id_product";
 $query.=" left join ". _DB_PREFIX_."product_lang pl on p.id_product=pl.id_product AND pl.id_lang='".$id_lang."'";
 $query.=" left join ". _DB_PREFIX_."lang l on pl.id_lang=l.id_lang";
 $query.=" left join ". _DB_PREFIX_."tax_rule tr on tr.id_tax_rules_group=ps.id_tax_rules_group AND tr.id_country='".$id_country."'  AND tr.id_state='".$id_state."'";
 $query.=" left join ". _DB_PREFIX_."tax t on t.id_tax=tr.id_tax";
 $query.=" left join ". _DB_PREFIX_."tax_lang tl on t.id_tax=tl.id_tax AND tl.id_lang='".$id_lang."'";
 $query.=" WHERE ps.id_shop='".$id_shop."' AND p.id_product='".$_GET['id_product']."' ";

... but in your case the lines with tables "product_lang pl" and "lang l" seem to have been merged into one line.

Share this post


Link to post
Share on other sites

@thejackal

Did you change the source code?

 

No, the source code was original and I didn't touch it.  Maybe I cut and pasted it weird in the forum, but the code was exactly the way you put it above in order-edit.php.

 

Do you think this has anything to do with me setting up as multi-shop?

Share this post


Link to post
Share on other sites

jackal, can you try the attached version?

 

BTW: in which country are you? This is about a piece of code I wrote for Italy. 

Share this post


Link to post
Share on other sites

jackal, can you try the attached version?

 

BTW: in which country are you? This is about a piece of code I wrote for Italy. 

Hi Music, it works now!  Thank you so much!

 

I am in USA, by the way.  

Share this post


Link to post
Share on other sites

Hi, I'm using this great script to edit product descriptions. Is it possible to increase the size of the textarea for short and long descriptions without manually expanding the box, by using rows and cols?

 

I assume these lines would need editing but I'm not sure how:

 

if (in_array("shortdescription", $input["fields"]))
    $infofields[$if_index++] = array("description_short","", "description_short", DISPLAY, 0, LEFT, NO_SORTER, TEXTAREA);
  if (in_array("description", $input["fields"]))
    $infofields[$if_index++] = array("description","", "description", DISPLAY, 0, LEFT, NO_SORTER, TEXTAREA);
Cheers

 

hi thanks alot for dis awesome script... i have one problem... how can i add product attribute to all the products in a shot... is this requirement posible with dis script... please reply...

Share this post


Link to post
Share on other sites

@thejackal: thank you for helping improve the script. It looks like you haven't set the tax rate for your state yet. The script wasn't prepared for that situation...

 

@anithaveerasimman121: yes you can. Click on "features". Select the features you want and then click on search to make them visible. After you have done that you will see those features in the list in the mass update window.

Share this post


Link to post
Share on other sites

@thejackal: thank you for helping improve the script. It looks like you haven't set the tax rate for your state yet. The script wasn't prepared for that situation...

 

Thanks @musicmaster.  It happens that the items sold are not taxable. :)

Share this post


Link to post
Share on other sites

This module works great on v 1.6.0.6

It is awesome for updating your feature items on the home category!

Share this post


Link to post
Share on other sites

If you are planning to update, there is a feature missing, mass edit qty, at the moment i can edit general qty, but i have many products with different variants, for example if i have 10 items size 1 and 10 size 2, i have a total of 20, and i can change to 20, ( i don't know what happens, i didn't try) but if i want to change the size 1 to 12 instead of 10 and leave the size 2 to 10 how can this be done? 

Share this post


Link to post
Share on other sites

@benedettopresta

You can:

 - search for a specific item in the name of a product and then change (mass edit) only those 

 - click away those lines that you don't want to change

 

I hope this answers your question as I was not totally sure whether I understood it right.

Share this post


Link to post
Share on other sites

this is just if you want to update and insert this feature, because i already fix it manually one by one.

 

Ok let me try to be a little more clear. 

 

I sell swimming suits, so i have variants, the same article in more colors and sizes.

so if i have article 1 in red, blu, and green, and i have 10 each, in qty with your script i see article 1 with 30 as qty. what i would like to see is 10 red, 10 blu, 10 green. So i can change them individually. 

 

Let me know if it's clear, if not i will try with screenshots. 

 

 

Ok, ok. Found it, you have it in combination. Need to do one article at the time. so forget the last post. Sorry.

Edited by benedettopresta (see edit history)

Share this post


Link to post
Share on other sites

Yes i did and i have to thank you again, because i'm starting to use it more and more, and it is saving me lot's of time. Great Module. 

Share this post


Link to post
Share on other sites

Hi,

 

I have a list of products IDs and i want to move them all to another category or categories.   How can i mass move them to other categories?

 

I tried to list them by search and then mass edit them, but the search only accept 2 total words.

 

 

I think it's easier this way to mass move products from one category to another. I think its good if you want to move your product in an archive, etc.

 

Can this be done with this actual version? Thanks

 

 

Also... i think something that it's important and it's missing... ->  AVAILABLE FOR ORDER  field... 

Edited by perusi (see edit history)

Share this post


Link to post
Share on other sites

Hi  Perusi,

 

Available for order is now under the extra's.

 

You can now fill in comma separated values in the second search field. See also the Readme file.

 

Can you have a look?

 

Cheers,

M

Share this post


Link to post
Share on other sites

Hi ,i have a problem with the script.I tested on my wamp server and it works absolutely great.Also change password etc.

Despite the fact i tested on localserver and is working  when i added it to my liveserver after i enter  the username and password and it says add safe ip etc i get a 500 internal server error and i cant access my site,(both front and bo mode) and i need to restart my browser to see the site.Any ideas?

Share this post


Link to post
Share on other sites

Hi epsilongr, 

 

Two possibilities that I can think of:

 

 - it may just be coincidence. I encounter quite often other websites that offer a 500 error. Usually one page refresh is enough to get through it

 

 - if it is a permanent problem it could be the sessions. You could try to eliminate the code dealing with sessions in login1.php to see the effect.

 

Let me know if you find something more concrete. 

Edited by musicmaster (see edit history)

Share this post


Link to post
Share on other sites

Hi musicmaster,

thanks for the reply.

It seems that 1 solution is not working for me so i must try the 2nd with the sessions.But i havent the knowledge to edit the php files.

Thanks a lot for the reply and the infos.

Share this post


Link to post
Share on other sites

nice script.saved me soo much time this last year i am using it. one idea for development - can we implement macros to it- it will save so much more time for those like me who use it to translate products,desc, ect.

dont know if it is possible, so thanks anyway

Share this post


Link to post
Share on other sites

Hi,

 

Just want to thanks musicmaster for this fanstatic tool ! Just 1 word: AMAZING ! Keep up the good work, man.

 

cheers

Share this post


Link to post
Share on other sites

did anybody updated to ps 1.6.0.7? because i did and the entire folder disappeared. lucky i had a backup, so just in case before updating make yourself a backup.

 

musicmaster, i don't know if this is my issue or the update process i used, but have a look at it if you can. thanks. 

Share this post


Link to post
Share on other sites

@laziali: Can you explain what you would want macro's for? I can't think of concrete examples where it would be useful. In the mass edit there is an option to do search and replace for translations.

 

@Galanid: thanks

 

@benedettopresta: I am working to change the script into a module. That would solve the problem.

  • Like 1

Share this post


Link to post
Share on other sites

Hi, I cant instal module on PS 1.6., it show Module was installed, but i cant find it on list... what I need 2 do? Thx

Share this post


Link to post
Share on other sites

Hi, I cant instal module on PS 1.6., it show Module was installed, but i cant find it on list... what I need 2 do? Thx

You can't install like a regular module. Read the posts here from the beginning and it will explain. I am on 1.6 and it work just fine.

Share this post


Link to post
Share on other sites

You can't install like a regular module. Read the posts here from the beginning and it will explain. I am on 1.6 and it work just fine.

 

Hi, thx fo reply and quick solution? I cant read now 22 pages.... thx a lot.

Share this post


Link to post
Share on other sites

Hey musicmaster!

 

Thanks for the awesome script, helped a lot!

 

One notice: the mysql_connect, mysql_query, etc. functions are deprecated as of PHP 5.5.0.

Will there be an update for this script, that uses mysqli or PDO?

Share this post


Link to post
Share on other sites

@benedettopresta: I didn't know there was a problem with updates. But you can always get the newest version here.

 

@tUb26: attached a new version with mysqli. For those who want to try it out.

Share this post


Link to post
Share on other sites

Thanks for the update, just tested it out on PS 1.5 and 1.6 aswell. Works very well!

 

Looking forward for the upcoming releases.

Share this post


Link to post
Share on other sites

@benedettopresta: I didn't know there was a problem with updates. But you can always get the newest version here.

 

@tUb26: attached a new version with mysqli. For those who want to try it out.

Still cant instal it on PS 1.6.0.6 :/

Share this post


Link to post
Share on other sites
@musicmaster: yes and i am using that function and others almost every day. but i do the same commands routine every time when i import new products... it will be cool if i can record my routine ones and play it after...Anyway mass edit is a great work 

P.S.just got another idea: delete products :)

 

@jackrabbit: did u red the first post of the topic? try reinstall.

Share this post


Link to post
Share on other sites

Hi, its funny, how I cant reinstall it, if I cant instal it...

download>unzip>upload via ftp to your server>find www.yoursite.com/uploadedfolder/login1.php

Share this post


Link to post
Share on other sites

to be able to edit image describtions would be awesome.

love the script btw, helped me a lot!

 

would be really cool to add some css to the script to make it look prettier ;) but sure does it work either way

HUGE THANX

Share this post


Link to post
Share on other sites

I have now received enough reports from people trying the script with 1.6 and no one has reported any problems. So I have adapted the text in the first post so that this version is now officially for 1.5 and 1.6.

  • Like 1

Share this post


Link to post
Share on other sites

Musicmaster,

 

sorry that I am not going through the whole thread again - did this months ago :)

 

At this time the script could not handle advanced stock management quantities - as far as I remember. I tested yesterday the newest version of your cool script and noticed that it does not read out the correct quantities in our case. We use ASM.

 

Is this so? If so do you think you will support this some time?

 

thanks alot

Boris

Share this post


Link to post
Share on other sites

houzhongqiu: it is unclear to me what you were trying to change.

 

Boris: no there is no advanced stock management and there are no plans either at the moment/

Share this post


Link to post
Share on other sites

houzhongqiu: it is unclear to me what you were trying to change.

 

Boris: no there is no advanced stock management and there are no plans either at the moment/

 

I am using 1.5.6.2 prestashop.

 

But I use mass update product, and I submit all,the page change blank, can you tell me what reason or why?

 

Attach pictures

post-370981-0-11650200-1406478384_thumb.jpg

Edited by houzhongqiu (see edit history)

Share this post


Link to post
Share on other sites

I am using 1.5.6.2 prestashop.

 

But I use mass update product, and I submit all,the page change blank, can you tell me what reason or why?

 

Attach pictures

on tha attached pic a can not see what field you are editing.... you need to press the edit radio button, then edit and submit

Share this post


Link to post
Share on other sites

good work!

 

one problem though, edit product does not support inch sign "  

for the product that have " sign attach in the title, it will leave out the " sign and everything behind it.

so if a title is 7" hose, when you try to add it to the order, the product name will only display  7.

Share this post


Link to post
Share on other sites

Hi Bryanblue, 

 

Today I posted a new version. It should solve your problem.

 

Regards,

Working like a charm. Thanks musicmaster.

Share this post


Link to post
Share on other sites

I've written some scripts to edit orders, categories and products. In the latest version you will find the following:

- product-edit: this offers a much better overview than editing inside PS and has some mass update features. Provides also access to sales and visit statistics.

- product-list: this starts from the product_edit page and provides printable lists for inventory control

- order-edit: in 1.4 very useful; in 1.5 more versatile than PS.

- category-edit: very useful for SEO

- discount-list: an overview of the special prices your shop offers

- product-sort: an easy way to sort products inside a category. From place 100 to 1 in 1 second.

- shop-search: provides an overview of the search keywords visitors used inside your shop

 

Order edit was built on an older program (http://www.prestasho...post__p__630877) that was written for PS 1.3. Look in that thread for post #107 or #109 if you have PS 1.3.

 

You should unzip the file and copy the resulting files to your admin folder or a subdirectory below it (do not install as a PS module!).You can access the program in the browser like "www.myshop.com/myadmin/mydir/login1.php". You will be welcomed by a login screen: the default username is "demo@demo.com" and the default password is "opensecret". At the bottom of each page you will find links to the other programs.

 

There are two versions: one is for PS 1.4.x and one for 1.5.x and 1.6.x. 

 

Have fun and let everyone know with the Like button when you like it.

 

Updates of the 1.5/1.6 version:

0.97: improved column sort, active/onsale now binary, speed optimization. Mostly in product-edit.

0.98: added combination edit

0.99: added a few fields under extras. experimental discount edit

0.99k: editing discounts now mostly completed, image legend editable

prestashop is very difficult to work with. you cannot move products in bulk from one category to another. is there any way to do it without any additional programming?

Share this post


Link to post
Share on other sites

prestashop is very difficult to work with. you cannot move products in bulk from one category to another. is there any way to do it without any additional programming?

You can do that with this script. Choose product-edit, make category editable and under mass update you can find for category add and remove that will add and remove a category for every product on the page. Don't forget to submit.

Share this post


Link to post
Share on other sites

Hello,

I just installed the update and it works great on 1.6.0.6.

 

I have been seeing this error on the "Product Edit" screen lately and the update did not fix it.

Can anyone help me? Also just a note for some reason the product-edit screen has a green background and no links at the bottom for other edit options

 

Here is the error:

MySQL error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY position' at line 1
Generated by URL '/*********/product-category-edit/product-edit.php'
with Query 'SELECT id_image,cover FROM vrp_image WHERE id_product= ORDER BY position'

 

 

Thanks

Aaron

Share this post


Link to post
Share on other sites

Hi Aaron,

 

The green background means that there is an error. The attached file should solve it.

 

The problem is most likely that there is a product in your product_shop table that has an empty value for the product id. That crashed one of my queries.

 

Regards,

Share this post


Link to post
Share on other sites

Awesome! That fixed the problem and I can see the record with no ID.

Would you know how to delete it? It does not come up in my admin section.

This would also be a really good feature to add "Mass Delete" of products or categories.

 

Thanks!

 

Aaron

Share this post


Link to post
Share on other sites

Hi Aaron,

 

I deliberately left out mass delete. It reduces the chance for accidental disasters.

 

Prestashop has pretty good mass delete for products itself. It you prefer the more extensive selection options of my script you can use them to add some particular word to the product name and then search for that extension in the PS back office.

 

Mass delete for categories is indeed a considerable miss. However, it is rather complicated to program: you also need to deal with the products in those categories. And if you deal with those products you also need to deal with their properties - for example deleting their image files.

 

As far as I know empty product ids give no a problems. If you really want to get rid of them as far as I know the only way is directly accessing the database with for example phpmysqlAdmin.

 

Regards,

Share this post


Link to post
Share on other sites

Yes I usually move a bunch of products to inactive and then delete.

That being said is there a way to increase the current 498 item update limit?

Even if I have 1000 items displayed it will not update them all.

Thanks again awesome program!

Share this post


Link to post
Share on other sites

There is no fixed limit to the number of updated items. I assume it depends on your computing environment: how fast is your computer and how much memory does it have? Which operating system and which browser are you using?

 

So to achieve a maximum number of changed items at once I would suggest the following:

 - close all other programs. Close also all other windows in your browser.

 - experiment which browser can handle the most - and the fastest

 - when running the search ask only for fields that you really need. The "hide" function won't help you here: the data are still kept in memory when you hide them.

 

Please tell me your experiences. I never investigated this issue and I curious to know. Other people might find your experiences useful too.

Share this post


Link to post
Share on other sites

OK so here is what happens.

I am on windows Vista and the amount of browser windows has no effect.

Using Prestashop 1.6.0.6

 

I go to Product Edit and list a manufacturer name (or anything that will return 500+ results) the display fields are also not relevant but I choose to return more than 500 results per page.

 

I select the field name "Active" to be editable and then select the same field for mass update. I select the action to disable the field thus making the listed products "inactive" I then press the Submit All button and it goes to the update screen and says 498 processed with a bunch of record numbers and asterisks then back to my main screen where 50 of the items (out of the 500 listed) were not updated. I then go to my back office in Prestashop and confirm that I only have 498 items as disabled.

 

So it appears I can only update 498 items at one time even if I have 500 or 1000 that I have submitted for update. It looks like a programming limitation either in the code or a MySQL update loop. Sorry just guessing I am not a programmer.

 

So you should be able to replicate this fairly easily with a search that returns 600 or so results and change the Number of recs: from 100 to 500+

 

Thanks,

Aaron

Share this post


Link to post
Share on other sites

Here is a verbose report of the update:

Notice: Undefined variable: reccount in .............../public_html/Prestashop/psadmin/product-category-edit/product-proc.php on line 52

Go back to product-edit page

Records
SELECT id_feature, name FROM vrp_feature_lang WHERE id_lang='1' ORDER BY id_feature
SELECT id_lang FROM vrp_lang
select s.id_shop_group, g.share_stock, g.name from vrp_shop s, vrp_shop_group g WHERE s.id_shop_group=g.id_shop_group and id_shop='1'
*0: UPDATE vrp_product SET date_upd='2014-08-05 13:09:44', active='0' WHERE id_product='10200'
UPDATE vrp_product_shop SET date_upd='2014-08-05 13:09:44', active='0' WHERE id_product='10200' AND id_shop='1'

.

.

.

.

*497: UPDATE vrp_product SET date_upd='2014-08-05 13:09:44', active='0' WHERE id_product='10735'
UPDATE vrp_product_shop SET date_upd='2014-08-05 13:09:44', active='0' WHERE id_product='10735' AND id_shop='1'
*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes*No changes
Finished successfully!

Edited by gopetsquad (see edit history)

Share this post


Link to post
Share on other sites

I looked a bit further and I found that PHP has a limit. 

 

See for example this article: http://stackoverflow.com/questions/2341149/limit-of-post-arguments-in-html-or-php

 

I made a a script for you to phpinfo. So you can check the values of post_max_size and max_input_vars. On my test computer max_input_vars was 1000. I expect yours to be something similar. It would explain your number of 498 as that means 498 pairs of product id's and settings for the active field - and 4 general vars.

 

You could try to increase that php setting (max_input_vars) in php.ini. 

 

Maybe I will try some workaround. I could for example send the article numbers as one comma-separated field. But I will take some time to consider it. For the moment I will only adapt the manual.

 

Thank you for your inspiring input.

Share this post


Link to post
Share on other sites

I looked a bit further and I found that PHP has a limit. 

 

See for example this article: http://stackoverflow.com/questions/2341149/limit-of-post-arguments-in-html-or-php

 

I made a a script for you to phpinfo. So you can check the values of post_max_size and max_input_vars. On my test computer max_input_vars was 1000. I expect yours to be something similar. It would explain your number of 498 as that means 498 pairs of product id's and settings for the active field - and 4 general vars.

 

You could try to increase that php setting (max_input_vars) in php.ini. 

 

Maybe I will try some workaround. I could for example send the article numbers as one comma-separated field. But I will take some time to consider it. For the moment I will only adapt the manual.

 

Thank you for your inspiring input.

What is the latest version of module for ps 1.5.6.2 ? is it possible to add percentage increase in price ? for a specific category if it has multiple combinations

Share this post


Link to post
Share on other sites

Hi Lovemyseo,

 

"What is the latest version of module for ps 1.5.6.2 ?"

For 1.5 and 1.6 you can use the same software.

 

is it possible to add percentage increase in price ?

Yes, in the mass edit field of product edit you will find "increase%"

 

for a specific category if it has multiple combinations?

No, mass product-edit will update the base price. In combi-edit you have the option to set individual marginal prices but not to do that for all. It would be illogical to have such an option.

 

Regards

Share this post


Link to post
Share on other sites

Hi Lovemyseo,

 

"What is the latest version of module for ps 1.5.6.2 ?"

For 1.5 and 1.6 you can use the same software.

 

is it possible to add percentage increase in price ?

Yes, in the mass edit field of product edit you will find "increase%"

 

for a specific category if it has multiple combinations?

No, mass product-edit will update the base price. In combi-edit you have the option to set individual marginal prices but not to do that for all. It would be illogical to have such an option.

 

Regards

cant increase even quantities for products with combinations ?

Edited by lovemyseo (see edit history)

Share this post


Link to post
Share on other sites

cant increase even quantities for products with combinations ?

No, you increase the quantities for the individual combinations. To come there you need to activate the combinations field.

Share this post


Link to post
Share on other sites

No, you increase the quantities for the individual combinations. To come there you need to activate the combinations field.

and is it possbile to edit product one by one I do not see the save button there ?

Share this post


Link to post
Share on other sites

and is it possbile to edit product one by one I do not see the save button there ?

The hook at the end of each line is a "save" button for that line.

Share this post


Link to post
Share on other sites

Hi, Musicmaster, I am testing your great module with a 1.6.0.8 PS version. When installing the module, PS show me the message "add.gif is not a valid module name". Any suggestions?

Thanks!

Share this post


Link to post
Share on other sites

Hi nutxlago,

 

This is a script - not a module - and you are installing it the wrong way. Please read the text of post #1 of this thread and the readme of the script.

Share this post


Link to post
Share on other sites

Hi How do I "NB: Prior to mass update you need to make the field editable. Afterwards you need to submit the records." ?

 

Thank you

Share this post


Link to post
Share on other sites

It is a really great script and working on PS 1.6.0.8!

 

I have one problem that has occured and I can't figure out the problem.

 

When using "Product edit" and change quantites of products and then "Submit all" most of the time (but not always) I get error:

 

NW26 Records***********************22: **24:

MySQL error 1110: Column 'id_shop' specified twice
Generated by URL '/innar/admin164/massupdate/product-proc.php'
with Query 'INSERT INTO ps_stock_available SET quantity='0', id_shop ='1', id_shop=0, id_product='3117', out_of_stock='2''

--

Any ideas how to solve this?

If possible, could anu advice be given quicly, as site is going live and changing quantities of hundreds of products is the last thing I'm working on now :)

Thanks!

Share this post


Link to post
Share on other sites

Dear Musicmaster! (And others..)

 

First: big-big-big thanks for that product!

 

I would like to ask if it is possible to update default product category as well as adding a product to a category?

 

As I know, ps_product and ps_product_shop needs to be updated..

 

Anyway, do you have some repository to be able to contribute to the code? :)

 

Thank You in advance!
 

////// I run now these scripts to update the products default category from home/root to their normal added category:

UPDATE ps_product pu
SET id_category_default=
(
  SELECT max(id_category) FROM ps_category_product pcp
  WHERE pcp.id_product=pu.id_product
)
WHERE pu.id_category_default<3
 
 
UPDATE ps_product_shop pu
SET id_category_default=
(
  SELECT max(id_category) FROM ps_category_product pcp
  WHERE pcp.id_product=pu.id_product
)
WHERE pu.id_category_default<3

 

Edited by EnsoSzL (see edit history)

Share this post


Link to post
Share on other sites

Hi EnsoSzL,

 

You can change the default category with the star. The only thing lacking is a mass update for that.

 

If you have ideas for improvement, please tell me. Until now contributions from other to the script are very scarce.

 

Regards,

Share this post


Link to post
Share on other sites

call me an idiot, but how to use this module?

 

if i install it, i only see "The module was successfully downloaded"

 

and thats it?!

 

 

Share this post


Link to post
Share on other sites

call me an idiot, but how to use this module?

 

if i install it, i only see "The module was successfully downloaded"

 

and thats it?!

Okay: You are idiot. (You asked :P )

But this is not a Prestashop Modul.

 

This is a (very very useful) standalone script... see the first post how can you install and use it. ;)

Share this post


Link to post
Share on other sites

Okay: You are idiot. (You asked :P )

But this is not a Prestashop Modul.

 

This is a (very very useful) standalone script... see the first post how can you install and use it. ;)

 

 

lol ok thanks  :rolleyes:

  • Like 1

Share this post


Link to post
Share on other sites

Hi EnsoSzL,

 

You can change the default category with the star. The only thing lacking is a mass update for that.

 

If you have ideas for improvement, please tell me. Until now contributions from other to the script are very scarce.

 

Regards,

 

Thank You musicmaster! :) I have already used that function, but it's a one by one thing.. :)

 

I think a new action / checkbox for mass category add needed, for example AddAndSetPrimary action or checkbox stating "add for default category".

 

One of my client adds hundreds of new products (originally syncronized to the home or root category from the accounting system) to other categories, and of course the home / root category is not good for primary.. :) The root (being the default category) even makes problems in the system.. :)

 

Or simply there should be a button which can "reorganize" the default categories: if a product has home / root for default and has at least one other category, than one of that should be primary/default.. (My SQL script does sort of that..)

 

(Ups, other account from other virtual machine.. yikes..sorry)

Edited by eSzeL (see edit history)

Share this post


Link to post
Share on other sites

Hi Innar, Sorry to hear you experience problems.

 

Can you test the attached version?

Attached is the latest version of script?

Share this post


Link to post
Share on other sites

Hello and thank you very much for this awesome script :)

 

I saw using it that I have sort of " invisible " categorys in my PS 1.5.4.1 shop :

 

143261GhostCategorys.jpg

 

They are 90, 91, 92 and 93, corbeille name.

 

I have a Corbeille category in my back-office who is visible as 94 but I don't see 90 to 93 ones.

 

I have no idea how I created those and how to delete them safely.

 

Can I use the script to delete them ? I don't see how to do that.

Share this post


Link to post
Share on other sites

Attached is the latest version of script?

Being a few days late you would now do better to test the 0.99m version at post #1.

 

 

Hello and thank you very much for this awesome script :)

 

I saw using it that I have sort of " invisible " categorys in my PS 1.5.4.1 shop :

 

143261GhostCategorys.jpg

 

They are 90, 91, 92 and 93, corbeille name.

 

I have a Corbeille category in my back-office who is visible as 94 but I don't see 90 to 93 ones.

 

I have no idea how I created those and how to delete them safely.

 

Can I use the script to delete them ? I don't see how to do that.

I don't know what causes this. My assumption would be that they are in the category table but not in the category_shop table - or at least not for your current shop.

 

My preference would be to leave them where they are as they don't cause harm.

 

This script cannot delete categories or products. It can only modify them. That is a conscious design decision to limit the amount of harm that someone could cause with injudicious use. So you cannot delete those categories with it.

Share this post


Link to post
Share on other sites

Hi EnsoSzL,

 

I have uploaded a new version that allows "set as default" in the mass update. Can you test it?

 

Dear MusicMaster!

 

I uploaded and tested it, it works perfectly, thank You for adding this feature! :) This script is a must have! :)

 

I have a new problem, because my client finished building a massive category tree with repeating category names.. :)

 

The picture shows it:

http://ctrlv.in/420009

 

So I would like to ask a new feature: when adding Categories, the "myvalue" select texts should be prefixed with parent groups names, so instead of having the value just "Shoes", having "Adidas\Children\Shoes" so its clear which "Shoes"
category I am just selecting.. :)

 

Thank You so much in advance!

 

Sincerely,

eSzeL

Hungary

Edited by EnsoSzL (see edit history)

Share this post


Link to post
Share on other sites

I had this problem too in past... but i just modified a little the original product_edit.php. 
Just added the "Category ID" nubmer to Category name.
Not too elegant solution, but working for me.

I can shared my code, but i think: if musicmaster modded the product_edit.php it will so better, and more professional. :)

But this is, what i see now:
http://ctrlv.in/420015

...and of course in top of my product editor search bar, i see the "category name+category ID" too.

Edited by sptkyle (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

I had this problem too in past... but i just modified a little the original product_edit.php. 

Just added the "Category ID" nubmer to Category name.

Not too elegant solution, but working for me.

 

I can shared my code, but i think: if musicmaster modded the product_edit.php it will so better, and more professional. :)

 

But this is, what i see now:

http://ctrlv.in/420015

 

...and of course in top of my product editor search bar, i see the "category name+category ID" too.

 

Thank You sptkyle! Also added temporarily the ID, but yes, I think Mr. MusicMaster will do it more elegantly.. :)

Updated code (print screen):

http://ctrlv.in/420036

Share this post


Link to post
Share on other sites

Hello. I was just wondering, but the script for the 1.5 mass change also the shipping costs of the products? As with importing CSV this can be done.

Share this post


Link to post
Share on other sites