Hi, hat jemand eine Idee wie ich den Brutto-Warenwert einer Bestellung in der admin/html/compatibility/order_details.php als PHP-Variable verwenden kann? if ($GLOBALS['order']->totals['title'] == 'Zwischensumme:') { echo $GLOBALS['order']->totals['value']; } funktioniert nicht. Hier der Original-Code aus der Datei: Code: <tr id="order-sum-row"> <td colspan="<?php if($productInformation['allow_tax']) { ?>6<?php } else { ?>4<?php } ?>" class="text-right"> <div class="grid"> <?php $counter = 0; $countOrderTotals = count($GLOBALS['order']->totals); ?> <?php foreach($GLOBALS['order']->totals as $orderInfoArray): ?> <?php if($counter <= ($countOrderTotals - 2)): ?> <div class="span12"> <?php echo strip_tags($orderInfoArray['title']) ?> </div> <?php $counter++; ?> <?php endif; ?> <?php endforeach; ?> </div> </td> <td class="text-right"> <div class="grid"> <?php $counter = 0; ?> <?php foreach($GLOBALS['order']->totals as $orderInfoArray): ?> <?php if($counter <= ($countOrderTotals - 2)): ?> <div class="span12"> <?php echo $orderInfoArray['text'] ?> </div> <?php $counter++; ?> <?php endif; ?> <?php endforeach; ?> </div> </td> </tr>
Da fehlt eine Array-Ebene. Eher so: PHP: $subTotal = null;foreach ($GLOBALS['order']->totals as $orderTotal) { if ($orderTotal['code'] === 'ot_subtotal') { $subTotal = [ 'value' => $orderTotal['value'], 'text' => $orderTotal['text'], 'title' => $orderTotal['title'], ]; }}if ($subTotal !== null) { printf('%s: %s', $subTotal['title'], $subTotal['text']);} else { echo 'no subtotal';} Ungetestet, ich hab das nur eben schnell hier hingeschmiert.