Author Topic: Require Orders Model failed  (Read 413 times)

sprachrohr

  • Beginner
  • *
  • Posts: 24
Require Orders Model failed
« on: January 15, 2019, 13:55:46 pm »
Hello,

after Updating to VM 3.4.2 i have a problem. Joomla version is 3.9.1.

I have an Backend QuickIcon Plugin, where i require the VM Orders Model.
I used this code:
if (!class_exists('VirtueMartModelOrders')) {
   require(VMPATH_ADMIN . DS . 'models' . DS . 'orders.php');
}

After Update to VM 3.4.2 this code doesnt work anymore. I get a blank page without errors. Even if i fill in the whole path, i get a blank page.

Any suggestions?

Thank you!!!

Best regards
Dirk

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8890
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: Require Orders Model failed
« Reply #1 on: January 15, 2019, 15:26:21 pm »
maybe try
if (!class_exists( 'VmConfig' )) require(JPATH_ROOT .'/administrator/components/com_virtuemart/helpers/config.php');
VmConfig::loadConfig();

before it
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

sprachrohr

  • Beginner
  • *
  • Posts: 24
Re: Require Orders Model failed
« Reply #2 on: January 15, 2019, 15:58:47 pm »
thats it!!! Thanks a lot!!!

Could you explain why this is needed?

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8890
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: Require Orders Model failed
« Reply #3 on: January 15, 2019, 23:13:34 pm »
it ensures that the VM config is available and loaded
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation