Solved

Joomla

Posted on 2009-05-05
9
2,139 Views
Last Modified: 2013-12-12
I have an error with this Joomla Mynxx theme:
Fatal error: Class 'ps_DB' not found in /home/icanget/public_html/modules/mod_rokvirtuemart_scroller/helper.php on line 38 not sure how to fix this problem

<?php
/**
* @package RokIntroScroller
* @copyright Copyright (C) 2007 RocketWerx. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
 
// no direct access
defined('_JEXEC') or die('Restricted access');
 
require_once (JPATH_SITE.DS.'components'.DS.'com_content'.DS.'helpers'.DS.'route.php');
jimport('joomla.utilities.date');
 
$vmparser = JPATH_SITE.DS.'components'.DS.'com_virtuemart'.DS.'virtuemart_parser.php';
if (file_exists($vmparser)) require_once($vmparser);
 
class modRokVirtuemartScrollerHelper
{
		
	function getProducts(&$params)
	{
		global $mainframe, $my, $mosConfig_offset;
 
		$user		=& JFactory::getUser();
		$dispatcher	=& JDispatcher::getInstance();
		$userId		= (int) $user->get('id');
 
		$count		= (int) $params->get('count', 5);
		$aid		= $user->get('aid', 0);
		$show_title = trim($params->get( 'show_title', 1 ) );
		$show_price = trim($params->get( 'show_price', 0 ) );
		$sorting    = $params->get('sorting', 'random');
		$featured   = $params->get('featured', 'no');
		
		$contentConfig = &JComponentHelper::getParams( 'com_content' );
		$access		= !$contentConfig->get('shownoauth');
 
		$database = new ps_DB();
		require_once(CLASSPATH."ps_product.php");
		$ps_product = new ps_product;
 
		if($count>0) {
			$count = "LIMIT $count";
		} else {
			$count = "";
		}
 
		$query = "SELECT p.product_sku FROM #__{vm}_product AS p";
 
		$query .= "\nJOIN #__{vm}_product_category_xref as pc ON p.product_id=pc.product_id";
		/*if( $category_id != 0 ) {
			$query .= " AND pc.category_id=$category_id";
		}*/
		$query .= "\nJOIN #__{vm}_category as c ON pc.category_id=c.category_id";
		
		$query .= "\n WHERE p.product_publish = 'Y' AND c.category_publish = 'Y' AND product_parent_id=0 ";
		if( CHECK_STOCK && PSHOP_SHOW_OUT_OF_STOCK_PRODUCTS != "1") {
			$query .= " AND product_in_stock > 0 ";
		}
		
		if( $featured=='yes' ) {
			$query .= "\n AND product_special = 'Y' ";
		}
		
		switch( $sorting ) {
			case 'random':
				$query .= "\n ORDER BY RAND() $count";
				break;
			case 'newest':
				$query .= "\n ORDER BY p.cdate DESC $count";
				break;
			case 'oldest':
				$query .= "\n ORDER BY p.cdate ASC $count";
				break;
			default:
				$query .= "\n ORDER BY p.cdate DESC $count";
				break;
		}
		$database->query( $query );
 
		$rows = $database->record;
 
		// Process the prepare content plugins
		JPluginHelper::importPlugin('content');
 
		$i		= 0;
		$lists	= array();
		foreach ( $rows as $row )
		{
			$lists[$i] = $ps_product->product_snapshot($row->product_sku, $show_price, true, $show_title);
			$i++;
		}
 
		return $lists;
	}
 
 
 
}

Open in new window

0
Comment
Question by:rafique12
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
9 Comments
 
LVL 14

Expert Comment

by:shobinsun
ID: 24303000
Hi,

Check for the class " ps_DB " in joomla folder.

I think you installed the module unsuccessfully.
0
 

Author Comment

by:rafique12
ID: 24303055
sorry but I am not sure where to look...would the folder be in the includes of folder of Joomla or in the mynxx theme that I have uploaded?

I think I should point out that Joomla has been succesfully installed it is actually a module which is giving this error!
0
 
LVL 14

Expert Comment

by:shobinsun
ID: 24303362
Hi,

If you are using an IDE  ( For example, Eclipse ) then its very simple to search for that class.

Otherwise look at the includes folder or in the module..

0
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 

Author Comment

by:rafique12
ID: 24304299
there doesn't seem to be an includes folder for this module I'm not sure here!?!?
0
 
LVL 2

Expert Comment

by:pallavanj
ID: 24312227
Hi,
Add this line to line number: 37
require_once (JPATH_SITE.DS.'components'.DS.'com_virtuemart'.DS.'classes'.DS.'ps_database.php');

Open in new window

0
 
LVL 2

Expert Comment

by:pallavanj
ID: 24312239
Sorry,
I missed a path here..
add like this to line no 37
require_once (JPATH_SITE.DS.'administrator'.DS.'components'.DS.'com_virtuemart'.DS.'classes'.DS.'ps_database.php');

Open in new window

0
 
LVL 2

Expert Comment

by:pallavanj
ID: 24312267
if it fails,
then instead of adding the above line to line:37,, add it to line 10 or 13 where all includes are included..
0
 
LVL 3

Expert Comment

by:binarygeek
ID: 24312637
try this one if it works

comment out lines 14 and 15 and paste this code


if( file_exists(dirname(__FILE__).'/../../components/com_virtuemart/virtuemart_parser.php' )) {
	require_once( dirname(__FILE__).'/../../components/com_virtuemart/virtuemart_parser.php' );
} else {
	require_once( dirname(__FILE__).'/../components/com_virtuemart/virtuemart_parser.php' );
}

Open in new window

0
 
LVL 3

Accepted Solution

by:
binarygeek earned 500 total points
ID: 24312640
code should look like this

//$vmparser = JPATH_SITE.DS.'components'.DS.'com_virtuemart'.DS.'virtuemart_parser.php';
//if (file_exists($vmparser)) require_once($vmparser);
if( file_exists(dirname(__FILE__).'/../../components/com_virtuemart/virtuemart_parser.php' )) {
	require_once( dirname(__FILE__).'/../../components/com_virtuemart/virtuemart_parser.php' );
} else {
	require_once( dirname(__FILE__).'/../components/com_virtuemart/virtuemart_parser.php' );
}

Open in new window

0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to confirm and grey the submit button using JavaScript ? 14 67
Windows 10, 64 bit WAMP - won't start 9 30
Format Date 7 28
Can't Find The Code 15 20
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
This article discusses how to implement server side field validation and display customized error messages to the client.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question