Author Topic: [SOLVED] List Orders Error  (Read 7696 times)

design609

  • Jr. Member
  • **
  • Posts: 68
Re: [SOLVED] List Orders Error
« Reply #15 on: January 26, 2012, 03:23:22 am »
 
@Electrocity
Quote
  I have added a menu item - List Orders but when I click to view an order there are errors reported for each item on the order:
    Code: [Select]
    Warning: key() [function.key]: Passed variable is not an array or object in /--- website ---/administrator/components/com_virtuemart/plugins/vmcustomplugin.php on line 253
    I get the same result if I click on the 'view your order online' link in the confirmation email that is sent to the customer.
    Using VM2.0.0

    Edit - It only seems to happen when the product has custom fields!

fixed At revision: 5167

Since the problem is to be found i VM 2.0 and I tried the VM 2.0.1 which created new sets of problems - then I am forced to stay on with 2.0 for a while.
Could we might get an insight into which files have to be edited and with what so we can fix it on a VM 2.0 version?
This issue blackout customer (view order) and shopadmin (backend list orders) to see which item is ordered (custom field - image for instance)
Please...
(tried as above to replace content of that single file vmcustomplugin.php with the new one fram 2.0.1 but of course that not worked just moved error to :
/public_html/dev/administrator/components/com_virtuemart/plugins/vmcustomplugin.php on line 196)

design609

  • Jr. Member
  • **
  • Posts: 68
Re: [SOLVED] List Orders Error
« Reply #16 on: January 26, 2012, 04:12:48 am »
A very dirty fix (or rather hiding of this issue) for VM 2.0

I replaced content with VM 2.0 content of VM 2.0.1 files
/administrator/components/com_virtuemart/models/customfields.php
/administrator/components/com_virtuemart/plugins/vmcustomplugin.php

Went into the
 /administrator/components/com_virtuemart/plugins/vmcustomplugin.php

Edited:
line 188

Quote
    public function GetPluginInCart($product){
       //$plgName = $productCustom->value;

       if(!empty($product->param)){
         if (!is_array($product->param)) return false ;
         $param = array() ;
         
          foreach($product->param as $k => $plg){
             if (key($plg)== $this->_name)
             $param[$k]= $plg[$this->_name];
          }
         if ($param ) return $param ;
       }

       return null ;

    }

to
Quote
    public function GetPluginInCart($product){
       //$plgName = $productCustom->value;

       //if(!empty($product->param)){
         //if (!is_array($product->param)) return false ;
         //$param = array() ;
         
          //foreach($product->param as $k => $plg){
             //if (key($plg)== $this->_name)
             //$param[$k]= $plg[$this->_name];
          //}
         //if ($param ) return $param ;
       //}

       return null ;

    }

Now at least me and customers do not have to look at the error message and the custom filed type image is shown with image title...
I did not test where this is going to break some other stuff.


EDIT::::::::::::::::::::::::::::::::::::::::::::::::

hmmm.. this seems to have broken custom field type string on the frontend
:O

brunoazevedo

  • Beginner
  • *
  • Posts: 9
Re: [SOLVED] List Orders Error
« Reply #17 on: January 26, 2012, 12:26:18 pm »
Hi BanquetTables.pro,

Thanks. Working :)

But i found other problems/bug:

In product detail, the thumbnail image open with big dimensons.

The custon fieds not show in product Details.

Thanks
Bruno

zzsser

  • Beginner
  • *
  • Posts: 37
  • I love virtuemart but I dislike bugs :-(
Re: [SOLVED] List Orders Error
« Reply #18 on: January 27, 2012, 17:18:14 pm »
Hi BanquetTables.pro,

This is an interesting solution... For me this is not usefull because the fields "Text input" (what customers have to fill in) disappear on front-end.

zandee

  • Beginner
  • *
  • Posts: 1
Re: [SOLVED] List Orders Error
« Reply #19 on: February 02, 2012, 15:10:42 pm »
This problem was bought to my attention by a customer of mine, for whom the existing solution on this page was not sufficient.

The following code fixes the error and displays the custom fields.

Code: [Select]
public function GetPluginInCart($product){
    //$plgName = $productCustom->value;

    if(!empty($product->param)){
$param = array() ;

    foreach($product->param as $k => $plg){


    //if ($plg == $this->_name)
$param[]= $plg;
    }

if ($param ) return $param ;
    }

    return null ;

    }

beevo

  • Beginner
  • *
  • Posts: 16
Re: [SOLVED] List Orders Error
« Reply #20 on: February 10, 2012, 12:26:40 pm »
I'm having this error too for every product listed.

Can I just ask, where exactly are you getting VM 2.0.1 from? In the admin area it says that VM 2.0.0. is the latest version. Same on the VM website under downloads the only latest option is VM 2.0.0.

So where are you getting VM 2.0.1 from?
Using Joomla 3.4.4 and VM 3.0.10