$products[$i][$option]['options_values_price'] = $attributes_values['options_values_price']; $products[$i][$option]['price_prefix'] = $attributes_values['price_prefix']; } } } for ($i = 0, $n = sizeof($products); $i < $n; $i++) { if ($i / 2 == floor($i / 2)) { $info_box_contents[] = array('params' => 'class="productListing-even"'); } else { $info_box_contents[] = array('params' => 'class="productListing-odd"'); } $cur_row = sizeof($info_box_contents) - 1; $info_box_contents[$cur_row][] = array('align' => 'center', 'params' => 'class="productListing-data" valign="top"', 'text' => smn_draw_checkbox_field('cart_delete[]', $products[$i]['id'])); $products_name = '<table border="0" cellspacing="2" cellpadding="2">' . ' <tr>' . ' <td class="productListing-data" align="center"><a href="' . smn_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">' . smn_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>' . ' <td class="productListing-data" valign="top"><a href="' . smn_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '"><b>' . $products[$i]['name'] . '</b></a>'; if (STOCK_CHECK == 'true') { $stock_check = smn_check_stock($products[$i]['id'], $products[$i]['quantity']); if (smn_not_null($stock_check)) { $any_out_of_stock = 1; $products_name .= $stock_check; } } if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) { reset($products[$i]['attributes']); while (list($option, $value) = each($products[$i]['attributes'])) { $products_name .= '<br><small><i> - ' . $products[$i][$option]['products_options_name'] . ' ' . $products[$i][$option]['products_options_values_name'] . '</i></small>'; } } $products_name .= ' </td>' . ' </tr>' . '</table>'; $info_box_contents[$cur_row][] = array('params' => 'class="productListing-data"', 'text' => $products_name); $info_box_contents[$cur_row][] = array('align' => 'center', 'params' => 'class="productListing-data" valign="top"', 'text' => smn_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') . smn_draw_hidden_field('products_id[]', $products[$i]['id'])); $info_box_contents[$cur_row][] = array('align' => 'right', 'params' => 'class="productListing-data" valign="top"', 'text' => '<b>' . $currencies->display_price($products[$i]['final_price'], smn_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']) . '</b>');
$order = new order($invoice); } else { $invoice_query = smn_db_query("select orders_id from " . TABLE_ORDERS_INVOICE . " where orders_invoice_id = '" . $invoice . "'"); while ($invoice_data = smn_db_fetch_array($invoice_query)) { $orders_id = $invoice_data[orders_id]; $order = new order($orders_id); } } } else { $order = new order(); } // Stock Check $any_out_of_stock = false; if (STOCK_CHECK == 'true') { for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) { if (smn_check_stock($order->products[$i]['id'], $order->products[$i]['qty'])) { $any_out_of_stock = true; } } // Out of Stock if (STOCK_ALLOW_CHECKOUT != 'true' && $any_out_of_stock == true) { smn_redirect(smn_href_link(FILENAME_SHOPPING_CART)); } } $payment_modules->update_status(); if (is_array($payment_modules->modules) && sizeof($payment_modules->modules) > 1 && !is_object(${$payment}) || is_object(${$payment}) && ${$payment}->enabled == false) { smn_redirect(smn_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(ERROR_NO_PAYMENT_MODULE_SELECTED), 'SSL')); } require DIR_WS_CLASSES . 'order_total.php'; $order_total_modules = new order_total(); $order_totals = $order_total_modules->process();