News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

How to call VmConfig::$defaultLang property from the code of a some component?

Started by borro, September 28, 2016, 13:10:21 PM

Previous topic - Next topic

borro

Hello!

I'm developing the component, which interacts with VM 3. Inside of a model file I'm trying to biuld such select query:

$dbquery = 'SELECT product_name FROM #__virtuemart_products_'.VmConfig::$defaultLang;

But this code lead to the error "Class 'VmConfig' not found". How should I declare the "VmConfig" class in the model of a component?
Wish you happiness!

GJC Web Design

if (!class_exists( 'VmConfig' )) require(JPATH_ROOT.DS.'administrator'.DS.'components'.DS.'com_virtuemart'.DS.'helpers'.DS.'config.php');
      VmConfig::loadConfig();

      $model = VmModel::getModel('product');
      $userModel = VmModel::getModel('user');

etc

you can then use the VM models instead of writing your own queries etc
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation