Menu

#3 vm invoice manger can't findt Virtuemart

open-fixed
nobody
None
5
2010-06-02
2010-05-28
Anonymous
No

I get the massage "Vm Invoice Manager doesn't work without Virtuemart." but virtuemart is installed.

So I think somthing is wrong with this function

# DETECT IF VM IS INSTALLED
if(isVmInstalled()) { define('_VMINSTALLED', '1'); }
else
{
global $mainframe;
$mainframe->enqueueMessage(_VMINV_WARN_VMNOTINSTALLED, 'error');
$mainframe->redirect('index.php');
}

// an all the others

function isVmInstalled()
{
$isVm = 1;
$db =& JFactory::getDBO();
$count = "SELECT count(*) FROM #__components WHERE name = 'VirtueMart' ";
$db->setQuery( $count);
$total = $db->loadResult();
if(!$total>0) { $isVm = 0; }

if(file_exists(_VM_ADMIN_PATH.'virtuemart.cfg.php'))
{
require_once(_VM_ADMIN_PATH.'virtuemart.cfg.php');
}
else { $isVm = 0; }

if(file_exists(_VM_ADMIN_PATH .'classes'.DS.'currency'.DS.'class_currency_display.php'))
{
require_once(_VM_ADMIN_PATH .'classes'.DS.'currency'.DS.'class_currency_display.php');
}
else { $isVm = 0; }

RETURN $isVm;
}

Any Suggestions?

Discussion

  • mitchie

    mitchie - 2010-05-29

    Hi,

    try to add comment code '/*' and '*/' like this:

    function isVmInstalled()
    {
    $isVm = 1;
    /*
    $db =& JFactory::getDBO();
    $count = "SELECT count(*) FROM #__components WHERE name = 'VirtueMart' ";
    $db->setQuery( $count);
    $total = $db->loadResult();
    if(!$total>0) { $isVm = 0; }
    */
    if(file_exists(_VM_ADMIN_PATH.'virtuemart.cfg.php'))
    {
    require_once(_VM_ADMIN_PATH.'virtuemart.cfg.php');
    }
    else { $isVm = 0; }

    if(file_exists(_VM_ADMIN_PATH .'classes'.DS.'currency'.DS.'class_currency_display.php'))
    {
    require_once(_VM_ADMIN_PATH .'classes'.DS.'currency'.DS.'class_currency_display.php');
    }
    else { $isVm = 0; }

    RETURN $isVm;
    }

    Than let me know.
    claudio

     
  • mitchie

    mitchie - 2010-06-02
    • status: open --> open-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB