Access to PrestaShop corporate website
Bonjour, Invité |
| S'inscrire
Se souvenir de moi Mot de passe oublié ?
Site Map Plan du site Contact us Contactez-nous
PrestaShop
  675 Membres en ligne
Forum  >  English Forum  >  Third party modules  >  Fil

1 de 2
1
Répondre
Nouveau sujet
[Solved] Group Functionality for CMS / Info block

offline
Publié : 19 Juin 2009 12:34 PM   [ Ignorer ]
Apprentice
RankRank
Avatar

Messages :

  • au total : 32
  • 7 derniers jours : 0
Inscrit: 2009-06-03

After much playing around, I’m please to offer Group based CMS functionality for Prestashop 1.12Beta.

There are three files that I had to change to allow the functionality.

  • Classes/CMS.php
  • admin/tabs/AdminCMS.php
  • modules/blockinfos/blockinfos.php

No core functionality change to the CMS, just allowing Groups to be used exactly like they are in Categories.

I’ve heard a few mutters about this one, and then when I needed it myself, I thought I’d give it a shot. Let me know if there are any issues, I’ve tested it on my own system and all seems to be working.

Instructions
———————————————————————————————————

Download the zip file
1) Backup your database and all files
2) Rename the above mentioned files to .bak or something (just in case)
3) Upload the contents of the archive to your site (rename the admin directory to whatever you’ve called it)
4) You’ll need to add the following table into your database (replace ps12 with your prefix)

CREATE TABLE `sitefx_store`.`ps12__cms_group` (
`id_category` int( 10 ) unsigned NOT NULL ,
`id_group` int( 10 ) unsigned NOT NULL ,
KEY `category_group_index` ( `id_category` , `id_group` )
)

5) Done.. go into the CMS and assign the default group to all of your entries.

Fichiers joints
cmsgroups.zip  (Taille du fichier : 7KB - Téléchargements : 228)
 Signature 

FOR HIRE - Aussie PHP/MySQL Developer - PM me for a quote

Stuff I’ve worked on
[MOD] Paypal Fees passed on to customer [thread]

[MOD] Added Group Functionality for CMS / Info block [thread]

[MOD] Display Shipping Fees/Carriers prior to Checkout / AJAX [thread]

 
offline
Publié : 26 Juin 2009 09:20 AM   [ Ignorer ]   [ # 1 ]
Apprentice
RankRank
Avatar

Messages :

  • au total : 32
  • 7 derniers jours : 0
Inscrit: 2009-06-03

Well, I thought it was useful lol.. wink

 Signature 

FOR HIRE - Aussie PHP/MySQL Developer - PM me for a quote

Stuff I’ve worked on
[MOD] Paypal Fees passed on to customer [thread]

[MOD] Added Group Functionality for CMS / Info block [thread]

[MOD] Display Shipping Fees/Carriers prior to Checkout / AJAX [thread]

 
offline
Publié : 04 Juillet 2009 07:39 AM   [ Ignorer ]   [ # 2 ]
Senior Member
RankRankRank
Avatar

Messages :

  • au total : 328
  • 7 derniers jours : 0
Inscrit: 2009-01-22

Hey i just noticed this, no one else might have a use for it yet but ill say thank you for your work.

i think ive actually got a use for it.

 Signature 

logo_developercertgrey_90x68.gif
Paypal Certified Developer Directory

 
offline
Publié : 07 Juillet 2009 04:46 AM   [ Ignorer ]   [ # 3 ]
Apprentice
RankRank

Messages :

  • au total : 29
  • 7 derniers jours : 0
Inscrit: 2009-06-29

I actually don’t understand what this is for.
Is this module for assigning categories within CMS?
then this is very useful indeed.
I think people aren’t taking it up because it was a bit vague what this module was about.

Would this be compatible with v. 1.1?

 
offline
Publié : 07 Juillet 2009 01:22 PM   [ Ignorer ]   [ # 4 ]
Senior Member
RankRankRank
Avatar

Messages :

  • au total : 328
  • 7 derniers jours : 0
Inscrit: 2009-01-22

its so only certain groups can see a CMS page, for example wholesale customers will only be able to see certain wholesale pages if its asigned to the group that they are assigned to.

 Signature 

logo_developercertgrey_90x68.gif
Paypal Certified Developer Directory

 
offline
Publié : 07 Juillet 2009 04:47 PM   [ Ignorer ]   [ # 5 ]
Apprentice
RankRank

Messages :

  • au total : 29
  • 7 derniers jours : 0
Inscrit: 2009-06-29

Ah I see smile
I didn’t realise that Categories had the group function too.. goes to check it out

BTW It’s great to see fellow Aussies using PS wink

 
offline
Publié : 07 Juillet 2009 11:59 PM   [ Ignorer ]   [ # 6 ]
Senior Member
RankRankRank
Avatar

Messages :

  • au total : 328
  • 7 derniers jours : 0
Inscrit: 2009-01-22

PS rocks, so easy to build into any format once you understand the schema.

 Signature 

logo_developercertgrey_90x68.gif
Paypal Certified Developer Directory

 
offline
Publié : 03 Octobre 2009 11:37 AM   [ Ignorer ]   [ # 7 ]
Regular
RankRank
Avatar

Messages :

  • au total : 53
  • 7 derniers jours : 0
Inscrit: 2009-04-14

Very interesting … you upgrade to version 1.2.4?

thanks

 Signature 

Bye
Paolo
RevitLandia

 
offline
Publié : 05 Octobre 2009 11:45 AM   [ Ignorer ]   [ # 8 ]
Beginner
Rank

Messages :

  • au total : 20
  • 7 derniers jours : 0
Inscrit: 2009-09-23

Hi, this is great functionality!

Does this work with 1.2.4?

grin
 Signature 

Stig

 
offline
Publié : 11 Octobre 2009 10:55 PM   [ Ignorer ]   [ # 9 ]
Club Member
RankRankRank
Avatar

Messages :

  • au total : 123
  • 7 derniers jours : 0
Inscrit: 2009-10-04

Nice, I was looking for such a feature ! does it work with v1.2.4 ??

And can you tell us how to get the group a website visitor is belonging ?

Thx

 Signature 

signé: LionHell

 
offline
Publié : 14 Octobre 2009 11:04 AM   [ Ignorer ]   [ # 10 ]
Club Member
RankRankRank
Avatar

Messages :

  • au total : 123
  • 7 derniers jours : 0
Inscrit: 2009-10-04

OK it’s working fine with prestashop 1.2.4

However I’ve modified adminCMS.php so that it can use text editor.
(file jointed below)

Fichiers joints
AdminCMS.zip  (Taille du fichier : 4KB - Téléchargements : 97)
 Signature 

signé: LionHell

 
offline
Publié : 14 Octobre 2009 12:48 PM   [ Ignorer ]   [ # 11 ]
Beginner
Rank

Messages :

  • au total : 20
  • 7 derniers jours : 0
Inscrit: 2009-09-23

Hi,

I have a great use for this module – thanks for sharing.

I’m using 1.24 and have it installed fine. But I do have a small problem that when I tick the group name boxes in CMS admin the Save function doesn’t save to the new table. So in the shop the information block is blank.

I attached a quick screenshot from php MyAdmin showing the table has been added ok.

Any help greatly appreciated……

Thanks

Stig

Images jointes
table.jpg
 Signature 

Stig

 
offline
Publié : 14 Octobre 2009 01:01 PM   [ Ignorer ]   [ # 12 ]
Beginner
Rank

Messages :

  • au total : 20
  • 7 derniers jours : 0
Inscrit: 2009-09-23

LionHell, did you make any other changes to get this to work with 1.2.4?

 Signature 

Stig

 
offline
Publié : 14 Octobre 2009 01:58 PM   [ Ignorer ]   [ # 13 ]
Club Member
RankRankRank
Avatar

Messages :

  • au total : 123
  • 7 derniers jours : 0
Inscrit: 2009-10-04

You must create a new table in your DB whose name is yourprefix_cms_group .

If you forgot to do that , the interface will work, but nothing will be save !!!

In brief:

- Create new table in DB (prefix_cms_group).

- Replace the 3 files (/tabs/adminCMS.php, classes/CMS.php, modules/blockinfos/blockinfos.php).

- Edit all your cms to check the group(s) authorized to watch them.

That’s all …

PS: If you create a CMS that only 1 particular group can see, dont forget to login on your site with an account belonging to that group !

 Signature 

signé: LionHell

 
offline
Publié : 14 Octobre 2009 02:24 PM   [ Ignorer ]   [ # 14 ]
Beginner
Rank

Messages :

  • au total : 20
  • 7 derniers jours : 0
Inscrit: 2009-09-23

lionhell - 14 Octobre 2009 01:58 PM
You must create a new table in your DB whose name is yourprefix_cms_group .

If you forgot to do that , the interface will work, but nothing will be save !!!

In brief:

- Create new table in DB (prefix_cms_group).

- Replace the 3 files (/tabs/adminCMS.php, classes/CMS.php, modules/blockinfos/blockinfos.php).

- Edit all your cms to check the group(s) authorized to watch them.

That’s all …

PS: If you create a CMS that only 1 particular group can see, dont forget to login on your site with an account belonging to that group !

Hi LionHell,

Yes, I have the new table and I replaced the three files. I tried the original and also your new version of AdminCMS.php. The interface works, but the ticks in the group boxes aren’t saved. Other changes to the page content are saved. I can see the table ps_cms_group in phpMyAdmin is empty.

Maybe there is something wrong with the table? Here is the SQL statement I used:

CREATE TABLE `web113-pshop`.`ps_cms_group` (

`id_category` int( 10 ) unsigned NOT NULL ,

`id_group` int( 10 ) unsigned NOT NULL ,

KEY `category_group_index` ( `id_category` , `id_group` )

)

The table was created fine.

Your help is appreciated.

 Signature 

Stig

 
offline
Publié : 14 Octobre 2009 02:39 PM   [ Ignorer ]   [ # 15 ]
Club Member
RankRankRank
Avatar

Messages :

  • au total : 123
  • 7 derniers jours : 0
Inscrit: 2009-10-04


— Serveur: localhost
— Généré le : Mar 13 Octobre 2009 à 15:59
— Version du serveur: 5.1.37
— Version de PHP: 5.3.0

SET SQL_MODE=“NO_AUTO_VALUE_ON_ZERO”;

/*!40101 SET OLD_CHARACTER_SET_CLIENT=@CHARACTER_SET_CLIENT */;
/*!40101 SET OLD_CHARACTER_SET_RESULTS=@CHARACTER_SET_RESULTS */;
/*!40101 SET OLD_COLLATION_CONNECTION=@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;


— Base de données: `name_of_your_DB`

— ————————————————————————————


— Structure de la table `your-prefix_cms_group`

CREATE TABLE IF NOT EXISTS `your-prefix_cms_group` ( `id_cms` int(10) unsigned NOT NULL, `id_group` int(10) unsigned NOT NULL, KEY `cms_group_index` (`id_cms`,`id_group`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

Here is a dump of my cms_group table …
Try to import it in your DB (change prefix to use yours).

 Signature 

signé: LionHell

 
 
1 de 2
1
Réponse rapide
Nouveau sujet