From 2010, we leave the forum to be run by the community, so if you need help from OSE or have a pre-sales question, please ask the question in our support desk at  https://www.opensource-excellence.com/tickets/ OR email to tickets@opensource-excellence.com. We will check your problems as soon as possible and provide the answers to the new WIKI website: http://wiki.opensource-excellence.com/. It will be greatly appreicated that you could share your solutions in the forum after we answer your questions. :D

Control Virtuemart category display mod

Open Source Membership Control Plugins

Control Virtuemart category display mod

Postby rtpr » Fri Feb 05, 2010 7:02 am

Through the great OSE support we were able to accomplish a nice mod that others might also find use of.

If you have multiple Virtuemart Categories that you only want to allow certain membership to have access to. This mod will allow you to only display the Virtuemart Categories that a member has access to when a member accesses /index.php?option=com_virtuemart

Once you have OSE installed and operational with the VM Pro plug in use to control your VM Categories for the memberships, by default if you go to yourdomain.com/index.php?option=com_virtuemart you will see all the VM categories listed for all memberships, however according to the membership type of the user, though they can see the categories, they will be blocked once they click to access those categories....this mod will remove them from displaying if they don't have access to them.

Follow these instructions:

1. open the file : /components/com_virtuemart/themes/default/templates/common/categoryChildlist.tpl.php
(default is the default VM theme...if you are using a different theme for your VM then find the file in the theme you are using)

2. open the file and around line 16 you will see this:
<?php
foreach( $categories as $category ) {
if ($iCol == 1) { // this is an indicator wether a row needs to be opened or not
echo "<tr>\n";
}
?>

REPLACE IT WITH

<?php
foreach( $categories as $category ) {



if ($iCol == 1) { // this is an indicator wether a row needs to be opened or not
}


// OSE MOdified Codes Starts
$database =& JFactory::getDBO();
require_once(JPATH_ADMINISTRATOR.DS."components".DS."com_osemsc".DS."warehouse".DS."api.php");
$api=new OSEMSCAPI();
$allowed_access = $api->ACLCheck("vm", "cat", $category["category_id"], $redirection = false);
if ($allowed_access==true)
{
?>


3. Once you have uploaded the file, public will not see the VM categories of members and members will see public categories and only the member categories they have access to.

hope this helps
rtpr
 
Posts: 1
Joined: Sun Jan 24, 2010 10:07 pm

Return to Open Source Membership Control Plugins

Who is online

Users browsing this forum: No registered users and 1 guest

cron