How to connect external script to functions of virtumart v4.4, joomla 5.2?
Previous versions did this:
<?php
define('_JEXEC', 1);
if (!defined('_JDEFINES'))
{
define('JPATH_BASE', dirname(__FILE__));
require_once JPATH_BASE . '/includes/defines.php';
}
require_once JPATH_BASE . '/includes/framework.php';
use \Joomla\CMS\Factory;
// Boot the DI container
$container = \Joomla\CMS\Factory::getContainer();
$container->alias('session.web', 'session.web.site')
->alias('session', 'session.web.site')
->alias('JSession', 'session.web.site')
->alias(\Joomla\CMS\Session\Session::class, 'session.web.site')
->alias(\Joomla\Session\Session::class, 'session.web.site')
->alias(\Joomla\Session\SessionInterface::class, 'session.web.site');
// Instantiate the application.
$app = $container->get(\Joomla\CMS\Application\SiteApplication::class);
// $session = $container->get(\Joomla\CMS\Session\Session::class);
// Set the application as global app
\Joomla\CMS\Factory::$application = $app;
$app->createExtensionNamespaceMap();
// $app->initialise();
require_once(JPATH_ADMINISTRATOR.'/components/com_virtuemart/helpers/config.php');
require_once(JPATH_ADMINISTRATOR.'/components/com_virtuemart/helpers/calculationh.php');
VmConfig::loadConfig();
require_once(JPATH_ADMINISTRATOR.'/components/com_virtuemart/models/product.php');
$model = new VirtueMartModelProduct();
$lang = VmConfig::$defaultLang;
$db = Factory::getContainer()->get('DatabaseDriver');
$live_site = trim(Joomla\CMS\Uri\Uri::root(), '/');
$calculator = calculationHelper::getInstance();
//my functions
?>
Now not working this variant.