News:

Looking for documentation? Take a look on our wiki

Main Menu

Get order details by order id

Started by Kuubs, April 28, 2017, 12:14:05 PM

Previous topic - Next topic

Kuubs

Is it possible to get all the orderdetails via an order id? With a virtuemart function?

GJC Web Design

orders model

/**
    * Load a single order, Attention, this function is not protected! Do the right manangment before, to be certain
     * we suggest to use getMyOrderDetails
    */
   public function getOrder($virtuemart_order_id){ 

there is also


public static function getOrderIdByOrderNumber($orderNumber){
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

Kuubs

Quote from: GJC Web Design on April 28, 2017, 14:04:49 PM
orders model

/**
    * Load a single order, Attention, this function is not protected! Do the right manangment before, to be certain
     * we suggest to use getMyOrderDetails
    */
   public function getOrder($virtuemart_order_id){ 

there is also


public static function getOrderIdByOrderNumber($orderNumber){

Thanks for this. And how can I use this in my list.php file in the orders template folder? VmFunctions?

GJC Web Design

as any VM function is called

defined('DS') or define('DS', DIRECTORY_SEPARATOR);
if (!class_exists( 'VmConfig' )) require(JPATH_ROOT .'/administrator/components/com_virtuemart/helpers/config.php');
if(!class_exists('VmModel'))require(JPATH_VM_ADMINISTRATOR.DS.'helpers'.DS.'vmmodel.php');
            $order_model = VmModel::getModel('orders');
            $myorder = $order_model->getOrder($virtuemart_order_id);

you may not need all this -- depends what is initialised in your file
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

Kuubs

Quote from: GJC Web Design on April 29, 2017, 00:43:40 AM
as any VM function is called

defined('DS') or define('DS', DIRECTORY_SEPARATOR);
if (!class_exists( 'VmConfig' )) require(JPATH_ROOT .'/administrator/components/com_virtuemart/helpers/config.php');
if(!class_exists('VmModel'))require(JPATH_VM_ADMINISTRATOR.DS.'helpers'.DS.'vmmodel.php');
            $order_model = VmModel::getModel('orders');
            $myorder = $order_model->getOrder($virtuemart_order_id);

you may not need all this -- depends what is initialised in your file

Thanks GJC Web Design. You've helped me a lot of times with Virtuemart now, now but also in the past. Cannot thank you enough for that!