Jump to content

[CONTRIBUTION] Sort Order in PrestaShop CMS

Recommended Posts

  • 3 weeks later...
  • 11 months later...


Thanks for this plugin.. however when I tried to install it... I'm running into some issues:

# Unzip the mod and copy all .php files to the root folder of your shop.
# Run the command "cms.sql" against your database in phpMyAdmin. If you have used a prefix other than "ps_" for your tables, modify this file accordingly (i.e. if config/settings.inc.php has '_DB_PREFIX_' set to 'ps1_', change `ps_cms` to `ps1_cms` in cms.sql.)

Unzip part, there's 2 directories in the zipped file, do I unzip them into the root, thus the files will replace the existing files in the modules & classes directories in the server? (this will cause my original infoblock module to be emptied of my existing information...

Run command cms.sql:

How DO I do that? Noob in phpmyadmin... Tried running it in the ps_ database under SQL tab by typing in CMS.SQL, but there's 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 'cms.sql' at line 1

Thank you.

Share this post

Link to post
Share on other sites
  • 5 weeks later...
  • 1 month later...
  • 2 weeks later...

In phpmyadmin, navigate to your database, and then in the SQL tab paste the content of the cms.sql file (alter table `ps_cms` add `sort_order` int(8) unsigned default '0' after `id_cms`). Apply and its done :)

Share this post

Link to post
Share on other sites
  • 4 weeks later...

Oh my god, I did it as suggested, now everything in CMS is gone, AND in phpMyAdmin this error appears:

#1034 - Incorrect key file for table 'ps_cms'; try to repair it

I use wampserver and made a backup, changing it back to the backup didnt solve the problem, Should I also have made a backup for the database in phpMyAdmin? I didnt know that, and dont know how.

I tried to see if it worked, but nothing changed, so I restarted wamp and now nothing is shown in CMS and its says bad SQL.

What do I need to do to fix this.

Please help!

Don C.

Share this post

Link to post
Share on other sites

(See post before). Still not working.

I reloaded the backup again, and now the infoblock is working as before, so as the old module.

But now I see an error loading phpMyAdmin in IE, but not in Chrome!.

So I tried to install it again as described, and it still doesnt work... I also installed the php files.

In the phpMyAdmin in ps_cms it is indeed changed; the sort orded / 0 is added.

id_cms - sort_order
1 - 0
2 - 0
3 - 0
4 - 0
5 - 0
7 - 0
8 - 0
9 - 0
and so

But in the Backoffice the module is not changed. so there must be something wrong, with this also the phpMyAdmin error in message IE.

Who can help me/knows what I am doing wrong here.

Many thanks in advance!!

Share this post

Link to post
Share on other sites

I looked into the phpMyAdmin, and I think its in the setting in pc_cms file, there are a lot of settings...
There must be something that I need to change I guess, I have no experience however, but would like this solved.
I spent a lot of time on this already, can anyone please help?

Thanks in advance.

Share this post

Link to post
Share on other sites

Who can help with this please?

I just found out that when I select an item in infoblock there is nothing shown, only this message:

Fatal error: Class 'ObjectModel' not found in C:\wamp\www\prestashop\CMS.php on line 16

I checked but couldnt find anything, but of course I am not experienced with this.
Line 15-21 is:

class CMS extends ObjectModel
public $meta_title;
public $meta_description;
public $meta_keywords;
public $content;
public $link_rewrite;

So the CMS file that thatsoftwareguy uses not correct or is something else wrong?

I apprechiate any help.


Share this post

Link to post
Share on other sites
  • 2 weeks later...
  • 8 months later...
  • 1 year later...

Hi. For those who wants change the list of CMS items automatically just by its ID, here is it :


1. Open and edit file classes/cms.php

2. Find the function getCMSPages

3. change this: ORDER BY `position`' to this: ORDER BY `position` DESC'



Hope that helps to somebody.

Share this post

Link to post
Share on other sites
  • 1 year later...
This topic is now closed to further replies.
  • Create New...

Important Information

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