Author Topic: Notice: Undefined offset: 0 in currencydisplay.php on line 183  (Read 436 times)

stAn99

  • Contributing Developer
  • Jr. Member
  • *
  • Posts: 87
    • One Page Checkout for Virtuemart 2
Notice: Undefined offset: 0 in currencydisplay.php on line 183
« on: October 17, 2018, 14:55:56 pm »
hello friends, when using shopper groups with a logged in customer that has only one shopper group associated on vm3.4.2.dev i am getting this notice (which breaks session when error reporting is enabled):

Notice: Undefined offset: 0 in currencydisplay.php on line 183

the line in currencydisplay is:
Code: [Select]
$sprgrp = $shopperModel->getShopperGroup($user->shopper_groups[0]);

i suggest to rather use the first one instead of referencing it with zero index:

Code: [Select]
$first = reset($user->shopper_groups);
$sprgrp = $shopperModel->getShopperGroup($first);

it seems that vmtable optimalization loads IDs as keys which is nice, but all VM needs to be checked agains using
  • index.


best regards, stan
----
RuposTel.com
www.rupostel.com
Your customized checkout solution for Virtuemart