News:

Support the VirtueMart project and become a member

Main Menu

Fatal error: Cannot use string offset as an array in...

Started by carlos.alonso, March 20, 2012, 18:02:11 PM

Previous topic - Next topic

carlos.alonso

Hi,

Joomla 1.73, VM 2.0.2

When i try to confirm my order from the cart I get the following error:

Fatal error: Cannot use string offset as an array in mysite/plugins/vmcustom/stockable/stockable.php on line 436

I have had a look at that piece of code:

public function plgVmGetProductStockToUpdateByCustom(&$item, $pluginParam, $productCustom) {

      if ($productCustom->custom_element !== $this->_name) return false ;
//vmdebug('$pluginParam',$pluginParam[$this->_name]);
      $item->virtuemart_product_id = (int)$pluginParam[$this->_name]['child_id'];
      return true ;
      // echo $item[0]->virtuemart_product_id;jexit();
   }

The line with the problem is the $item->virtuemart_product_id = (int)$pluginParam[$this->_name]['child_id'];, but i have checked and the child products have their ids.

Any help will be very much apreciated.

     carlos

nrg

my custom field is a simply VM-Custom, stockable variants plugin for choose the product size (ie. S,M,L,XL), everything looks and works fine on the front page, but after choosing shipment and payment method in last step, when i press "Confirm Order" button, i have exactly the same problem, with the same error msg like carlos.alonso .:
Fatal error: Cannot use string offset as an array in C:\xampp\htdocs\mytummy\plugins\vmcustom\stockable\stockable.php on line 436

does anyone have any ideas how to fix this problem ? or where could be the problem ?

regards

btw.
if i turn off the plugin (VM - Custom, stockable variants) i can confirm order without any problem and error msg. but of course i can't choose the product size !


Georgios Kolomvos

I have the same problem (in Joomla 2.5.4 and VM 2.0.7d).
I suspect that this is a problem with PHP5.3
Carlos and nrg, please check and let us know: do you have PHP5.3 also?
Georgios Kolomvos
Patras, Greece

winstart

have the same problem, working with 2.0.8e version
can't seem to save the stockable variants
and get a failure on line 227