$optDetails = [];
$explodeRef = explode("|", $refs);
+
if (sizeof($explodeRef) > 1) {
$options = json_decode($productsInfosBase[$id][0]['json'], true);
if(!$options) {
}
$counter = -1;
- foreach ($explodeRef as $key => $ref) {
- if ($counter > -1) {
- $options_ = $options[$counter]['options'];
- foreach ($options_ as $opt_) {
- if ($opt_["ref"] === $ref) {
- $opt[$refs][] = $opt_["sale_price"];
- $optDetails[] = ucfirst($options[$counter]['name_fr']) . ' : ' . $ref;
+ try {
+ foreach ($explodeRef as $key => $ref) {
+ if ($counter > -1) {
+ $options_ = $options[$counter]['options'];
+ foreach ($options_ as $opt_) {
+ if ($opt_["ref"] === $ref) {
+ $opt[$refs][] = $opt_["sale_price"];
+ $optDetails[] = ucfirst($options[$counter]['name_fr']) . ' : ' . $ref;
+ }
}
}
+ $counter++;
}
- $counter++;
+ }catch(\Exception $e) {
+ return $opt;
}
}