while ($products = tep_db_fetch_array($products_query)) { $contents[] = array('text' => $products['customers_basket_quantity'] . ' x ' . $products['products_name']); $attributes = array(); if (strpos($products['products_id'], '{') !== false) { $combos = array(); preg_match_all('/(\\{[0-9]+\\}[0-9]+){1}/', $products['products_id'], $combos); foreach ($combos[0] as $combo) { $att = array(); preg_match('/\\{([0-9]+)\\}([0-9]+)/', $combo, $att); $attributes[$att[1]] = $att[2]; } } $shoppingCart->add_cart(tep_get_prid($products['products_id']), $products['customers_basket_quantity'], $attributes); } $contents[] = array('text' => tep_draw_separator('pixel_black.gif', '100%', '1')); $contents[] = array('align' => 'right', 'text' => TEXT_SHOPPING_CART_SUBTOTAL . ' ' . $currencies->format($shoppingCart->show_total())); } else { $contents[] = array('text' => ' '); } } else { $contents[] = array('text' => 'N/A'); } } if (tep_not_null($heading) && tep_not_null($contents)) { echo ' <td width="25%" valign="top">' . "\n"; $box = new box(); echo $box->infoBox($heading, $contents); echo ' </td>' . "\n"; } ?> </tr>
$shoppingCart = new shoppingCart(); do { $contents[] = ['text' => $Qproducts->valueInt('customers_basket_quantity') . ' x ' . $Qproducts->value('products_name')]; $attributes = []; if (strpos($Qproducts->value('products_id'), '{') !== false) { $combos = []; preg_match_all('/(\\{[0-9]+\\}[0-9]+){1}/', $Qproducts->value('products_id'), $combos); foreach ($combos[0] as $combo) { $att = []; preg_match('/\\{([0-9]+)\\}([0-9]+)/', $combo, $att); $attributes[$att[1]] = $att[2]; } } $shoppingCart->add_cart(tep_get_prid($Qproducts->value('products_id')), $Qproducts->valueInt('customers_basket_quantity'), $attributes); } while ($Qproducts->fetch()); $contents[] = array('align' => 'right', 'text' => OSCOM::getDef('text_shopping_cart_subtotal') . ' ' . $currencies->format($shoppingCart->show_total())); } else { $contents[] = array('text' => ' '); } } else { $contents[] = array('text' => 'N/A'); } } if (tep_not_null($heading) && tep_not_null($contents)) { echo ' <td width="25%" valign="top">' . "\n"; $box = new box(); echo $box->infoBox($heading, $contents); echo ' </td>' . "\n"; } ?> </tr>
$cart = new shoppingCart(); } ?> <?php if (!is_object($currencies)) { $currencies = new currencies(); } ?> <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?> " class="text-warning"><?php echo Translate('Winkelwagen'); ?> </a></br> <?php echo Translate('Items'), ': ', '<span class="text-info">', $cart->count_contents(), '</span><br/>'; ?> <?php echo Translate('Totaal'), ': ', '<span class="text-info">', $currencies->format($cart->show_total()), '</span>'; ?> <?php } else { ?> <?php echo Translate('Bezig met verwerking...'); ?> <?php } ?> </div>