$table_inner_array[] = array('case' => 'name', 'products_name' => $listing['products_name'], 'products_link' => xos_href_link(FILENAME_PRODUCT_INFO, 'p=' . $listing['products_id'])); } break; case 'PRODUCT_LIST_INFO': $table_inner_array[] = array('case' => 'info', 'products_info' => $listing['products_info']); $smarty->assign('product_info', true); break; case 'PRODUCT_LIST_PACKING_UNIT': $table_inner_array[] = array('case' => 'packing_unit', 'products_p_unit' => $listing['products_p_unit']); break; case 'PRODUCT_LIST_MANUFACTURER': $table_inner_array[] = array('case' => 'manufacturer', 'manufacturers_name' => $listing['manufacturers_name'], 'manufacturers_link' => xos_href_link(FILENAME_DEFAULT, 'm=' . $listing['manufacturers_id'])); break; case 'PRODUCT_LIST_PRICE': $popup_content_id = xos_get_delivery_times_values($listing['products_delivery_time_id'], 'popup_content_id'); $table_inner_array[] = array('case' => 'price', 'price_breaks' => $price_breaks, 'products_id' => $listing['products_id'], 'products_delivery_time' => xos_get_delivery_times_values($listing['products_delivery_time_id']), 'link_filename_popup_content_products_delivery_time' => $popup_content_id > 0 ? xos_href_link(FILENAME_POPUP_CONTENT, 'co=' . $popup_content_id . '&p=' . $listing['products_id'], $request_type) : '', 'tax_description' => xos_get_products_tax_description($listing['products_tax_class_id'], $products_tax_rate), 'price' => $product_price, 'price_special' => $product_price_special, 'price_breaks' => $price_breaks_array); break; case 'PRODUCT_LIST_QUANTITY': $table_inner_array[] = array('case' => 'quantity', 'products_quantity' => $listing['products_quantity'] > 0 ? $listing['products_quantity'] : '<span class="red-mark">' . $listing['products_quantity'] . '</span>'); break; case 'PRODUCT_LIST_WEIGHT': $table_inner_array[] = array('case' => 'weight', 'products_weight' => $listing['products_weight']); break; case 'PRODUCT_LIST_IMAGE': $products_image_name = xos_get_product_images($listing['products_image']); if (!empty($_GET['m'])) { $table_inner_array[] = array('case' => 'image', 'products_image_small' => xos_lazy_image(DIR_WS_IMAGES . 'products/small/' . rawurlencode($products_image_name['name']), $listing['products_name'], '', '', 'class="img-responsive center-block lazy" style="display: none;"') . '<noscript>' . xos_image(DIR_WS_IMAGES . 'products/small/' . rawurlencode($products_image_name['name']), $listing['products_name'], '', '', 'class="img-responsive center-block"') . '</noscript>', 'products_image_medium' => xos_lazy_image(DIR_WS_IMAGES . 'products/medium/' . rawurlencode($products_image_name['name']), $listing['products_name'], '', '', 'class="img-responsive center-block lazy" style="display: none;"') . '<noscript>' . xos_image(DIR_WS_IMAGES . 'products/medium/' . rawurlencode($products_image_name['name']), $listing['products_name'], '', '', 'class="img-responsive center-block"') . '</noscript>', 'products_link_image' => xos_href_link(FILENAME_PRODUCT_INFO, 'm=' . $_GET['m'] . '&p=' . $listing['products_id'])); } else { $table_inner_array[] = array('case' => 'image', 'products_image_small' => xos_lazy_image(DIR_WS_IMAGES . 'products/small/' . rawurlencode($products_image_name['name']), $listing['products_name'], '', '', 'class="img-responsive center-block lazy" style="display: none;"') . '<noscript>' . xos_image(DIR_WS_IMAGES . 'products/small/' . rawurlencode($products_image_name['name']), $listing['products_name'], '', '', 'class="img-responsive center-block"') . '</noscript>', 'products_image_medium' => xos_lazy_image(DIR_WS_IMAGES . 'products/medium/' . rawurlencode($products_image_name['name']), $listing['products_name'], '', '', 'class="img-responsive center-block lazy" style="display: none;"') . '<noscript>' . xos_image(DIR_WS_IMAGES . 'products/medium/' . rawurlencode($products_image_name['name']), $listing['products_name'], '', '', 'class="img-responsive center-block"') . '</noscript>', 'products_link_image' => xos_href_link(FILENAME_PRODUCT_INFO, 'p=' . $listing['products_id'])); } $smarty->assign('product_image', true);
} } else { $product_price = $currencies->display_price($products_prices[0][0]['regular'], $products_tax_rate); $products_prices[0]['special_status'] == 1 && $products_prices[0][0]['special'] > 0 ? $product_price_special = $currencies->display_price($products_prices[0][0]['special'], $products_tax_rate) : ($product_price_special = ''); $sizeof = count($products_prices[0]); if ($sizeof > 2) { $array_keys = array_keys($products_prices[0]); for ($count = 2, $n = $sizeof; $count < $n; $count++) { $qty = $array_keys[$count]; $price_breaks_array[] = array('qty' => $qty, 'price_break' => $currencies->display_price($products_prices[0][$qty]['regular'], $products_tax_rate), 'price_break_special' => $products_prices[0]['special_status'] == 1 && $products_prices[0][$qty]['special'] > 0 ? $currencies->display_price($products_prices[0][$qty]['special'], $products_tax_rate) : ''); } } } $product_image = xos_get_product_images($products_new['products_image']); $popup_content_id = xos_get_delivery_times_values($products_new['products_delivery_time_id'], 'popup_content_id'); $products_new_array[] = array('link_filename_product_info' => xos_href_link(FILENAME_PRODUCT_INFO, 'p=' . $products_new['products_id']), 'href_buy_now' => xos_href_link(FILENAME_PRODUCTS_NEW, xos_get_all_get_params(array('action')) . 'action=buy_now&p=' . $products_new['products_id']), 'date_added' => xos_date_long($products_new['products_date_added']), 'image' => xos_image(DIR_WS_IMAGES . 'products/small/' . rawurlencode($product_image['name']), $products_new['products_name'], '', '', 'class="img-responsive"'), 'td_width_img' => SMALL_PRODUCT_IMAGE_MAX_WIDTH + 10, 'manufacturer' => $products_new['manufacturers_name'], 'tax_description' => xos_get_products_tax_description($products_new['products_tax_class_id'], $products_tax_rate), 'products_delivery_time' => xos_get_delivery_times_values($products_new['products_delivery_time_id']), 'link_filename_popup_content_products_delivery_time' => $popup_content_id > 0 ? xos_href_link(FILENAME_POPUP_CONTENT, 'co=' . $popup_content_id . '&p=' . $products_new['products_id'], $request_type) : '', 'price' => $product_price, 'price_special' => $product_price_special, 'price_breaks' => $price_breaks_array, 'info' => $products_new['products_info'], 'products_p_unit' => $products_new['products_p_unit'], 'products_model' => $products_new['products_model'], 'products_quantity' => $products_new['products_quantity'], 'name' => $products_new['products_name']); unset($price_breaks_array); } if (PREV_NEXT_BAR_LOCATION == '1' || PREV_NEXT_BAR_LOCATION == '3') { $smarty->assign('nav_bar_top', true); } if (PREV_NEXT_BAR_LOCATION == '2' || PREV_NEXT_BAR_LOCATION == '3') { $smarty->assign('nav_bar_bottom', true); } $smarty->assign('new_products', true); } $smarty->assign(array('nav_bar_number' => $products_new_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS_NEW), 'nav_bar_result' => '<nav><ul class="pagination">' . $products_new_split->display_links(MAX_DISPLAY_PAGE_LINKS, xos_get_all_get_params(array('page', 'info', 'lnc', 'cur', 'tpl', 'x', 'y'))) . '</ul></nav>', 'interval_days_back' => INTERVAL_DAYS_BACK, 'products_new' => $products_new_array)); $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'products_new'); } $output_products_new = $smarty->fetch(SELECTED_TPL . '/products_new.tpl', $cache_id); $smarty->assign('central_contents', $output_products_new);
if ($sizeof > 2) { $array_keys = array_keys($products_prices[0]); for ($count = 2, $n = $sizeof; $count < $n; $count++) { $qty = $array_keys[$count]; $price_breaks_array[] = array('qty' => $qty, 'price_break' => $currencies->display_price($products_prices[0][$qty]['regular'], $products_tax_rate), 'price_break_special' => $products_prices[0]['special_status'] == 1 && $products_prices[0][$qty]['special'] > 0 ? $currencies->display_price($products_prices[0][$qty]['special'], $products_tax_rate) : ''); } } } $products_description_array = array(); $description = preg_split("#<div[^>]*page-break-after[^>]*>.*?</div>#is", stripslashes($product_info['products_description'])); $tab_label = explode(',', $product_info['products_description_tab_label']); for ($i = 0, $n = sizeof($tab_label); $i < $n; $i++) { $products_description_array[] = array('tab_label' => trim($tab_label[$i]), 'description' => $description[$i]); } $popup_content_id = xos_get_delivery_times_values($product_info['products_delivery_time_id'], 'popup_content_id'); $smarty->assign(array('product_check' => true, 'products_name' => $product_info['products_name'], 'products_p_unit' => $product_info['products_p_unit'], 'products_delivery_time' => xos_get_delivery_times_values($product_info['products_delivery_time_id']), 'link_filename_popup_content_products_delivery_time' => $popup_content_id > 0 ? xos_href_link(FILENAME_POPUP_CONTENT, 'co=' . $popup_content_id . '&p=' . $product_info['products_id'], $request_type) : '', 'products_model' => $product_info['products_model'], 'products_weight' => $product_info['products_weight'], 'products_quantity' => STOCK_CHECK == 'true' ? $product_info['products_quantity'] > 0 ? $product_info['products_quantity'] : '<span class="red-mark">' . $product_info['products_quantity'] . '</span>' : '', 'products_price' => $product_price, 'products_price_special' => $product_price_special, 'products_price_breaks' => $price_breaks_array, 'products_tax_description' => xos_get_products_tax_description($product_info['products_tax_class_id'], $products_tax_rate), 'products_description' => $products_description_array)); $products_image_name = xos_get_product_images($product_info['products_image'], 'all'); if (xos_not_null($products_image_name)) { $pop_width = 0; $pop_height = 0; $small_height = 0; $small_width_total = 0; foreach ($products_image_name as $products_img_name) { if (count($products_image_name) > 1) { $small_img = DIR_WS_IMAGES . 'products/small/' . $products_img_name['name']; $small_size = @GetImageSize("{$small_img}"); $small_width_total += $small_size[0] + 10; if ($small_size[1] + 10 > $small_height) { $small_height = $small_size[1] + 10; } }
break; case 'delete': $heading_title = '<b>' . TEXT_INFO_HEADING_DELETE_DELIVERY_TIME . '</b>'; $form_tag = xos_draw_form('delivery_time', FILENAME_DELIVERY_TIMES, 'page=' . $_GET['page'] . '&dID=' . $dInfo->delivery_times_id . '&action=deleteconfirm'); if ($remove_delivery_time) { $contents[] = array('text' => TEXT_INFO_DELETE_INTRO); } $contents[] = array('text' => '<br /><b>' . $dInfo->delivery_times_text . '</b>'); $contents[] = array('text' => '<br /><a href="' . xos_href_link(FILENAME_DELIVERY_TIMES, 'page=' . $_GET['page'] . '&dID=' . $dInfo->delivery_times_id) . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_CANCEL . ' ">' . BUTTON_TEXT_CANCEL . '</a>' . ($remove_delivery_time ? '<a href="" onclick="delivery_time.submit(); return false" class="btn btn-danger btn-margin-infobox" title=" ' . BUTTON_TITLE_DELETE . ' ">' . BUTTON_TEXT_DELETE . '</a>' : '') . '<br /> '); break; default: if (isset($dInfo) && is_object($dInfo)) { $heading_title = '<b>' . $dInfo->delivery_times_text . '</b>'; $contents[] = array('text' => '<a href="' . xos_href_link(FILENAME_DELIVERY_TIMES, 'page=' . $_GET['page'] . '&dID=' . $dInfo->delivery_times_id . '&action=edit') . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_EDIT . ' ">' . BUTTON_TEXT_EDIT . '</a><a href="' . xos_href_link(FILENAME_DELIVERY_TIMES, 'page=' . $_GET['page'] . '&dID=' . $dInfo->delivery_times_id . '&action=delete') . '" class="btn btn-danger btn-margin-infobox" title=" ' . BUTTON_TITLE_DELETE . ' ">' . BUTTON_TEXT_DELETE . '</a>'); $delivery_times_inputs_string = ''; $languages = xos_get_languages(); for ($i = 0, $n = sizeof($languages); $i < $n; $i++) { $delivery_times_inputs_string .= '<br />' . xos_image(DIR_WS_CATALOG_IMAGES . 'catalog/templates/' . DEFAULT_TPL . '/' . $languages[$i]['directory'] . '/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . xos_get_delivery_times_values($dInfo->delivery_times_id, 'delivery_times_text', $languages[$i]['id']); } $contents[] = array('text' => $delivery_times_inputs_string); if ($dInfo->popup_content_id > 0) { $contents[] = array('text' => '<br />' . TEXT_INFO_POPUP_CONTENT_ID . ' ' . $dInfo->popup_content_id); } } break; } $smarty->assign(array('info_box_heading_title' => $heading_title, 'info_box_form_tag' => $form_tag, 'info_box_contents' => $contents)); $output_infobox_delivery_times = $smarty->fetch(ADMIN_TPL . '/includes/boxes/infobox_delivery_times.tpl'); $smarty->clearAssign(array('info_box_heading_title', 'info_box_form_tag', 'info_box_contents')); $smarty->assign('infobox_delivery_times', $output_infobox_delivery_times); }
$options_values_price = $currencies->format(xos_add_tax($currencies->currencies[$_SESSION['currency']]['value'] * $attributes_values['options_values_price'], $products_tax_rate)); } $attributes_array[] = array('products_options_name' => $attributes_values['products_options_name'], 'options_values_id' => $value, 'products_options_values_name' => $attributes_values['products_options_values_name'], 'options_values_price' => $options_values_price, 'hidden_field' => $hidden_field, 'price_prefix' => $attributes_values['price_prefix']); } } if (STOCK_CHECK == 'true') { $stock_check = xos_check_stock($products[$i]['id'], $products[$i]['quantity']); if (xos_not_null($stock_check)) { $any_out_of_stock = 1; $products_name .= $stock_check; } } $tax_rate = xos_display_tax_value($products_tax_rate); $product_image = xos_get_product_images($products[$i]['image']); $popup_content_id = xos_get_delivery_times_values($products[$i]['delivery_time_id'], 'popup_content_id'); $products_array[] = array('checkbox_cart_delete' => xos_draw_checkbox_field('cart_delete[]', $products[$i]['id'], false, 'id="cart_delete_' . ($i + 1) . '"'), 'link_filename_product_info' => xos_href_link(FILENAME_PRODUCT_INFO, 'p=' . urlencode($products[$i]['id'])), 'link_remove_product' => xos_href_link(FILENAME_SHOPPING_CART, 'action=remove_product&rmp=0&p=' . urlencode($products[$i]['id'])), 'products_image' => xos_image(DIR_WS_IMAGES . 'products/small/' . rawurlencode($product_image['name']), $products[$i]['name']), 'products_name' => $products[$i]['name'], 'products_packaging_unit' => $products[$i]['packaging_unit'], 'products_delivery_time' => xos_get_delivery_times_values($products[$i]['delivery_time_id']), 'link_filename_popup_content_products_delivery_time' => $popup_content_id > 0 ? xos_href_link(FILENAME_POPUP_CONTENT, 'co=' . $popup_content_id . '&p=' . $products[$i]['id'], $request_type) : '', 'products_model' => $products[$i]['model'], 'stock_check' => $stock_check, 'input_and_hidden_fields_quantity' => xos_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'id="cart_quantity_' . ($i + 1) . '" class="form-control cart-input-quantity" size="2" maxlength="5"') . xos_draw_hidden_field('p[]', $products[$i]['id']), 'products_tax' => xos_display_tax_value($products_tax_rate), 'products_price' => $currencies->format($products[$i]['price']), 'products_final_single_price' => $currencies->format($products[$i]['final_price']), 'products_final_price' => $currencies->format($products[$i]['quantity'] * $products[$i]['final_price']), 'products_attributes_option_price' => $attributes_options_values_price, 'products_attributes' => $attributes_array); if (isset($tax_rate)) { $tax_rates[$tax_rate] = '1'; } unset($attributes_array); } include DIR_WS_CLASSES . 'payment.php'; $payment_modules = new payment(); $initialize_checkout_methods = $payment_modules->checkout_initialization_method(); $alternative_checkout_methods_array = array(); if (!empty($initialize_checkout_methods)) { reset($initialize_checkout_methods); while (list(, $value) = each($initialize_checkout_methods)) { $alternative_checkout_methods_array[] = array('value' => $value); } }
for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) { $attributes_options_values_price = false; if (isset($order->products[$i]['attributes']) && sizeof($order->products[$i]['attributes']) > 0) { $order_attributes_array = array(); for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j++) { $options_values_price = ''; if ($order->products[$i]['attributes'][$j]['price'] != 0) { $attributes_options_values_price = true; $options_values_price = $order->products[$i]['attributes'][$j]['price_formated']; } $order_attributes_array[] = array('option_name' => $order->products[$i]['attributes'][$j]['option'], 'option_value_name' => $order->products[$i]['attributes'][$j]['value'], 'option_price' => $options_values_price, 'option_price_prefix' => $order->products[$i]['attributes'][$j]['prefix']); } } $tax_rate = xos_display_tax_value($order->products[$i]['tax']); $popup_content_id = xos_get_delivery_times_values($order->products[$i]['delivery_time_id'], 'popup_content_id'); $order_products_array[] = array('qty' => $order->products[$i]['qty'], 'model' => $order->products[$i]['model'], 'name' => $order->products[$i]['name'], 'packaging_unit' => $order->products[$i]['packaging_unit'], 'delivery_time' => xos_get_delivery_times_values($order->products[$i]['delivery_time_id']), 'link_filename_popup_content_delivery_time' => $popup_content_id > 0 ? xos_href_link(FILENAME_POPUP_CONTENT, 'co=' . $popup_content_id . '&p=' . $order->products[$i]['id'], $request_type) : '', 'tax' => $tax_rate, 'price' => $order->products[$i]['price_formated'], 'final_single_price' => $order->products[$i]['final_price_formated'], 'final_price' => $order->products[$i]['total_price_formated'], 'products_attributes_option_price' => $attributes_options_values_price, 'product_attributes' => $order_attributes_array); if (isset($tax_rate)) { $tax_rates[$tax_rate] = '1'; } unset($order_attributes_array); } if (MODULE_ORDER_TOTAL_INSTALLED) { $order_totals = $order_total_modules->output(); $order_totals_array = array(); for ($i = 0, $n = sizeof($order_totals); $i < $n; $i++) { $order_totals_array[] = array('totals_title' => $order_totals[$i]['title'], 'totals_text' => $order_totals[$i]['text'], 'totals_tax' => $order_totals[$i]['tax']); if ($order_totals[$i]['tax'] > -1) { $tax_rates[$order_totals[$i]['tax']] = '1'; } } }