Hello, Guest |
| Register
Remember me Forgot password ?
Site Map Site Map Contact us Contact us
PrestaShop
  459 users online
Forum  >  English Forum  >  Third party modules  >  Thread

1 of 2
1
Post Reply
New Topic
[Solved] Group Functionality for CMS / Info block

offline
Posted: 19 June 2009 12:34 PM   [ Ignore ]
Apprentice
RankRank
Avatar

Messages :

  • total: 32
  • last 7 days: 0
Joined: 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.

File Attachments
cmsgroups.zip  (File Size: 7KB - Downloads: 161)
 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
Posted: 26 June 2009 09:20 AM   [ Ignore ]   [ # 1 ]
Apprentice
RankRank
Avatar

Messages :

  • total: 32
  • last 7 days: 0
Joined: 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
Posted: 04 July 2009 07:39 AM   [ Ignore ]   [ # 2 ]
Senior Member
RankRankRank
Avatar

Messages :

  • total: 327
  • last 7 days: 0
Joined: 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

Please vote for me in the PayPalX Developer Challenge!

 
offline
Posted: 07 July 2009 04:46 AM   [ Ignore ]   [ # 3 ]
Apprentice
RankRank

Messages :

  • total: 29
  • last 7 days: 0
Joined: 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
Posted: 07 July 2009 01:22 PM   [ Ignore ]   [ # 4 ]
Senior Member
RankRankRank
Avatar

Messages :

  • total: 327
  • last 7 days: 0
Joined: 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

Please vote for me in the PayPalX Developer Challenge!

 
offline
Posted: 07 July 2009 04:47 PM   [ Ignore ]   [ # 5 ]
Apprentice
RankRank

Messages :

  • total: 29
  • last 7 days: 0
Joined: 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
Posted: 07 July 2009 11:59 PM   [ Ignore ]   [ # 6 ]
Senior Member
RankRankRank
Avatar

Messages :

  • total: 327
  • last 7 days: 0
Joined: 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

Please vote for me in the PayPalX Developer Challenge!

 
offline
Posted: 03 October 2009 11:37 AM   [ Ignore ]   [ # 7 ]
Regular
RankRank
Avatar

Messages :

  • total: 53
  • last 7 days: 0
Joined: 2009-04-14

Very interesting … you upgrade to version 1.2.4?

thanks

 Signature 

Bye
Paolo
RevitLandia

 
offline
Posted: 05 October 2009 11:45 AM   [ Ignore ]   [ # 8 ]
Beginner
Rank

Messages :

  • total: 20
  • last 7 days: 0
Joined: 2009-09-23

Hi, this is great functionality!

Does this work with 1.2.4?

grin
 Signature 

Stig

 
offline
Posted: 11 October 2009 10:55 PM   [ Ignore ]   [ # 9 ]
Club Member
RankRankRank
Avatar

Messages :

  • total: 114
  • last 7 days: 0
Joined: 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
Posted: 14 October 2009 11:04 AM   [ Ignore ]   [ # 10 ]
Club Member
RankRankRank
Avatar

Messages :

  • total: 114
  • last 7 days: 0
Joined: 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)

File Attachments
AdminCMS.zip  (File Size: 4KB - Downloads: 53)
 Signature 

signé: LionHell

 
offline
Posted: 14 October 2009 12:48 PM   [ Ignore ]   [ # 11 ]
Beginner
Rank

Messages :

  • total: 20
  • last 7 days: 0
Joined: 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

Image Attachments
table.jpg
 Signature 

Stig

 
offline
Posted: 14 October 2009 01:01 PM   [ Ignore ]   [ # 12 ]
Beginner
Rank

Messages :

  • total: 20
  • last 7 days: 0
Joined: 2009-09-23

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

 Signature 

Stig

 
offline
Posted: 14 October 2009 01:58 PM   [ Ignore ]   [ # 13 ]
Club Member
RankRankRank
Avatar

Messages :

  • total: 114
  • last 7 days: 0
Joined: 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
Posted: 14 October 2009 02:24 PM   [ Ignore ]   [ # 14 ]
Beginner
Rank

Messages :

  • total: 20
  • last 7 days: 0
Joined: 2009-09-23

lionhell - 14 October 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
Posted: 14 October 2009 02:39 PM   [ Ignore ]   [ # 15 ]
Club Member
RankRankRank
Avatar

Messages :

  • total: 114
  • last 7 days: 0
Joined: 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 of 2
1
Fast Reply
New Topic