VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: carlos.alonso on March 20, 2012, 18:02:11 PM

Title: Fatal error: Cannot use string offset as an array in...
Post by: carlos.alonso on March 20, 2012, 18:02:11 PM
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
Title: Re: Fatal error: Cannot use string offset as an array in...
Post by: nrg on April 27, 2012, 00:29:48 AM
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 !

Title: Re: Fatal error: Cannot use string offset as an array in...
Post by: Georgios Kolomvos on June 08, 2012, 14:42:35 PM
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?
Title: Re: Fatal error: Cannot use string offset as an array in...
Post by: winstart on August 22, 2012, 14:02:04 PM
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