HI,
I want make some changes to the code where the function used to save new orders. In particular I want to find the INSERT Query regarding new orders and write the virtuemart_order_id (last order ID+1) instead of the order_number. Anyone has an idea where is the file to chenge?Or other suggestions?
Thanks
there are at least two plugins for VM to choose the order numbers
I found the function that generate the order number. It's /administrator/components/com_virtuemart/models/orders.php
I manipulate in this way:
/**
* Generate a unique ordernumber using getHumanToken, which is a random token
* with only upper case chars and without 0 and O to prevent missreadings
* @author Max Milbers
* @param integer $virtuemart_vendor_id For the correct count
* @return string A unique ordernumber
*/
static public function genStdOrderNumber($virtuemart_vendor_id=1, $length = 4){
$db = JFactory::getDBO();
$q='SELECT `virtuemart_order_id` from r9uc1_virtuemart_orders ORDER BY `virtuemart_order_id` DESC limit 1';
$db->setQuery($q);
$c = $db->loadResult();
return ($c+1);
}
The problem now is how I can override this function. Anyone has an idea?
Thanks
Core functions are overriden by plugins, "there are at least two plugins for VM to choose the order numbers"
Quote from: jenkinhill on November 27, 2016, 22:29:00 PM
Core functions are overriden by plugins, "there are at least two plugins for VM to choose the order numbers"
Thanks,
I would like to develop this plugin on my own. Con you give me a link where I can study how to do?
A.
Google Search "Create a plug-in for Joomla 3.x"
Here: https://docs.joomla.org/J3.x:Creating_a_Plugin_for_Joomla (https://docs.joomla.org/J3.x:Creating_a_Plugin_for_Joomla)
First hit in Google... 8) 8) 8)