VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Coding Central => Topic started by: johnyDev on December 23, 2015, 11:04:56 AM

Title: Get current order item in plgVmDisplayInOrderFEVM3
Post by: johnyDev on December 23, 2015, 11:04:56 AM
How to get the current order item in

function plgVmDisplayInOrderFEVM3 (&$product, &$productCustom, &$html)

we used to have $item parameter in VM2 but now where is the order item ? 

I have posted the question in StackOverFlow also: http://stackoverflow.com/questions/34434023/get-order-item-line-in-virtuemart-3-inside-plgvmdisplayinorderfevm3
Title: Re: Get current order item in plgVmDisplayInOrderFEVM3
Post by: johnyDev on January 06, 2016, 01:49:41 AM
Please Any help I really need that
Title: Re: Get current order item in plgVmDisplayInOrderFEVM3
Post by: welrachid on January 10, 2016, 23:00:33 PM
Hi
Not sure if this works for you.
it works in one of my custom plugins.

   function plgVmDisplayInOrderBEVM3(&$item, &$productCustom, &$html) {
      $this->plgVmOnViewCartVM3($item,$productCustom,$html);
   }
   function plgVmOnViewCartVM3(&$product, &$productCustom, &$html) {
      if (empty($productCustom->custom_element) or $productCustom->custom_element != $this->_name) return false;
      if(empty($product->customProductData[$productCustom->virtuemart_custom_id][$productCustom->virtuemart_customfield_id])) return false;
      $myparams = array();
      foreach( $product->customProductData[$productCustom->virtuemart_custom_id] as $k =>$item ) {
         /*..........fill in the blanks.............*/
      }
   }