Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何在外部文件中获取VirtueMart 2产品的产品数据?_Php_Joomla_Joomla2.5_Product_Virtuemart - Fatal编程技术网

Php 如何在外部文件中获取VirtueMart 2产品的产品数据?

Php 如何在外部文件中获取VirtueMart 2产品的产品数据?,php,joomla,joomla2.5,product,virtuemart,Php,Joomla,Joomla2.5,Product,Virtuemart,是否可以在外部php文件中获取VirtueMart 2产品的数据 我正在使用joomla 2.5和VirtueMart 2,需要在同一主机上的php文件中检索产品数据。此php文件不是VirtueMart组件的一部分,也不是其他组件的一部分。这个文件应该将检索到的产品数据提供给jquery小部件…在我看来,这是不可能的 在我的例子中,最好的做法是构建一个joomla模块,并在helper php中输入我的所有代码。 我的ajax响应的php文件现在是模块的一部分。有了它,我可以轻松访问Virtu

是否可以在外部php文件中获取VirtueMart 2产品的数据


我正在使用joomla 2.5和VirtueMart 2,需要在同一主机上的php文件中检索产品数据。此php文件不是VirtueMart组件的一部分,也不是其他组件的一部分。这个文件应该将检索到的产品数据提供给jquery小部件…

在我看来,这是不可能的

在我的例子中,最好的做法是构建一个joomla模块,并在helper php中输入我的所有代码。 我的ajax响应的php文件现在是模块的一部分。有了它,我可以轻松访问VirtueMart 2产品:

if (!class_exists( 'VmConfig' )) require(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart'.DS.'helpers'.DS.'config.php');
VmConfig::loadConfig();
if (!class_exists( 'VmModel' )) require(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart'.DS.'helpers'.DS.'vmmodel.php');

$productModel = VmModel::getModel('Product');
$product = $productModel->getProduct(Product_ID);

在我看来这是不可能的

在我的例子中,最好的做法是构建一个joomla模块,并在helper php中输入我的所有代码。 我的ajax响应的php文件现在是模块的一部分。有了它,我可以轻松访问VirtueMart 2产品:

if (!class_exists( 'VmConfig' )) require(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart'.DS.'helpers'.DS.'config.php');
VmConfig::loadConfig();
if (!class_exists( 'VmModel' )) require(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart'.DS.'helpers'.DS.'vmmodel.php');

$productModel = VmModel::getModel('Product');
$product = $productModel->getProduct(Product_ID);

在我看来这是不可能的

在我的例子中,最好的做法是构建一个joomla模块,并在helper php中输入我的所有代码。 我的ajax响应的php文件现在是模块的一部分。有了它,我可以轻松访问VirtueMart 2产品:

if (!class_exists( 'VmConfig' )) require(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart'.DS.'helpers'.DS.'config.php');
VmConfig::loadConfig();
if (!class_exists( 'VmModel' )) require(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart'.DS.'helpers'.DS.'vmmodel.php');

$productModel = VmModel::getModel('Product');
$product = $productModel->getProduct(Product_ID);

在我看来这是不可能的

在我的例子中,最好的做法是构建一个joomla模块,并在helper php中输入我的所有代码。 我的ajax响应的php文件现在是模块的一部分。有了它,我可以轻松访问VirtueMart 2产品:

if (!class_exists( 'VmConfig' )) require(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart'.DS.'helpers'.DS.'config.php');
VmConfig::loadConfig();
if (!class_exists( 'VmModel' )) require(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart'.DS.'helpers'.DS.'vmmodel.php');

$productModel = VmModel::getModel('Product');
$product = $productModel->getProduct(Product_ID);