How to fix Smartaddons modules after Virtuemart Update

How to fix Smartaddons modules after Virtuemart Update

Recently we found out that after updating Virtuemart to 3.6 , some SmartAddons modules like 
 
  • SJ Listing Tabs for VirtueMart
  • SJ Super Category for Virtuemart
  • SJ Categories for VirtueMart
  • SJ Deals for VirtueMart
  • SJ Filter for VirtueMart
  • and ...
have problem in backend setting. In fact in module setting for section [Select Category] you see this error :
 
Maybe your component (Virtuemart) has been installed incorrectly. Please sure your component work properly. If you still get errors, please contact us via our forum or ticket system
 
There is no specific solution in smartaddons forum yet but we present a simple way to fix that. All above modules has is a file in path : 
 
core\fields\sjvmcategories.php
 
that using a variable with name JPATH_VM_ADMINISTRATOR which is not available in new version of virtuemart. So you need to simply change (near line 46 ):

if (!class_exists('VmModel')) {
                if (defined('JPATH_VM_ADMINISTRATOR') && file_exists(JPATH_VM_ADMINISTRATOR . '/helpers/vmmodel.php')) {
                    require JPATH_VM_ADMINISTRATOR . '/helpers/vmmodel.php';
                } else {
                    $this->error = 'Could not find VmModel helper';
                    return false;
                }
            }​
 
with below codes :
 
if (!class_exists('VmModel')) {
                if (file_exists(JPATH_ADMINISTRATOR . '/components/com_virtuemart/helpers/vmmodel.php')) {
                    require_once(JPATH_ADMINISTRATOR . '/components/com_virtuemart/helpers/vmmodel.php');
                } else {
                    $this->error = 'Could not find VmModel helper';
                    return false;
                }
            }
 
 Save the file and refresh module backend. the problem should be fixed!

Print  

Comments (4)

This comment was minimized by the moderator on the site

Almost working - after replace top menu (in admin) is missing - no posibility to save, close - there is no icon, so can't check is it working.
Can you help me?

Cezary
This comment was minimized by the moderator on the site

Hi, the replacement is related to Frontend not backend, did you full refresh (CTRL+F5) the backend?

Super User
This comment was minimized by the moderator on the site

Tried your patch but it is not working now. Backend buttons (save, close, etc.) dissapear after change. CSS styles gone. Thanks anyway for the effort. I'm forced to downgrade Virtuemart.

Javier H Eraso
This comment was minimized by the moderator on the site

Hi, If you lost the page style, maybe there is a fatal error because of incorrect replacement.
It's better to check error log of your host.

Super User
There are no comments posted here yet

Leave your comments

  1. For auto publish the comment you need to login first.
Attachments (0 / 3)
Share Your Location