<?php } ?> <div class="left"> <a href="<?php echo site_url('product/' . $product['products_id']); ?> "> <img alt="<?php echo $product['product_name']; ?> " title="<?php echo $product['product_name']; ?> " src="<?php echo product_image_url($product['product_image']); ?> " alt="default thumb" class="thumb" /> </a> <h3> <a href="<?php echo site_url('product/' . $product['products_id']); ?> "> <?php echo $product['product_name']; ?> </a> </h3> <p class="description"> <?php
/** * Output compare products table * * @access public * @return string */ function output_compare_products_table() { $content = ''; $products_images = array(); $products_titles = array(); $products_price = array(); $products_weight = array(); $products_sku = array(); $products_manufacturers = array(); $products_desciptions = array(); $products_attributes = array(); $products_variants = array(); if ($this->has_contents()) { $cols = array('<col width="20%">'); $col_width = round(80 / count($this->get_products())); foreach ($this->get_products() as $products_id) { $cols[] = '<col width="' . $col_width . '%">'; $product = load_product_library($products_id); $images = $product->get_images(); $product_title = $product->get_title(); $product_price = $product->get_price_formated(true); $product_weight = $product->get_weight(); $product_sku = $product->get_sku(); $image = is_array($images) ? $images[0]['image'] : $images; $products_titles[] = $product_title; if (!empty($product_price)) { $products_price[] = $product_price; } if (!empty($product_weight)) { $products_weight[] = ''; //$osC_Weight->display($product_weight, $product->get_weightClass()); } if (!empty($product_sku)) { $products_sku[] = $product_sku; } $manufacturer = $product->get_manufacturer(); if (!empty($manufacturer)) { $products_manufacturers[] = $manufacturer; } $description = $product->get_description(); if (!empty($description)) { $products_desciptions[] = $description; } $products_id = str_replace('#', '_', $products_id); $products_images[] = '<div class="image"> <a href="' . site_url('product/' . $products_id) . '" title="' . $product->get_title() . '"> <img alt="' . $product->get_title() . '" src="' . product_image_url($image) . '" /> </a> </div>' . '<a class="btn btn-mini" href="' . site_url('cart_add/' . $products_id) . '">' . lang('button_add_to_cart') . '</a>'; } $content .= '<table id="compareProducts" cellspacing="0" cellpadding="2" border="0" class="table-striped table-bordered">'; //add col groups $content .= '<colgroup>'; foreach ($cols as $col) { $content .= $col; } $content .= '</colgroup>'; //add product header $content .= '<tbody>'; $content .= '<tr class="first">'; $content .= '<th> </th>'; if (!empty($products_images)) { foreach ($products_images as $k => $product_image) { $content .= '<td' . ($k == count($products_images) - 1 ? ' class="last"' : '') . '>' . $product_image . '</td>'; } } $content .= '</tr>'; $content .= '</tbody>'; //add compare details $content .= '<tbody>'; $row_class = 'even'; //add product name if (!empty($products_titles)) { $content .= '<tr class="' . $row_class . '">' . '<th valign="top">' . lang('field_products_name') . '</th>'; foreach ($products_titles as $k => $product_title) { $content .= '<td' . ($k == count($products_titles) - 1 ? ' class="last"' : '') . ' valign="top">' . $product_title . '</td>'; } $content .= '</tr>'; $row_class = $row_class == 'even' ? 'odd' : 'even'; } //add product price if (!empty($products_price)) { $content .= '<tr class="' . $row_class . '">' . '<th>' . lang('field_products_price') . '</th>'; foreach ($products_price as $k => $product_price) { $content .= '<td' . ($k == count($products_price) - 1 ? ' class="last"' : '') . '>' . $product_price . '</td>'; } $content .= '</tr>'; $row_class = $row_class == 'even' ? 'odd' : 'even'; } //add product weight if (!empty($products_weight)) { $content .= '<tr class="' . $row_class . '">' . '<th>' . lang('field_products_weight') . '</th>'; foreach ($products_weight as $k => $product_weight) { $content .= '<td' . ($k == count($products_weight) - 1 ? ' class="last"' : '') . '>' . $product_weight . '</td>'; } $content .= '</tr>'; $row_class = $row_class == 'even' ? 'odd' : 'even'; } //add product sku if (!empty($products_sku)) { $content .= '<tr class="' . $row_class . '">' . '<th>' . lang('field_products_sku') . '</th>'; foreach ($products_sku as $k => $product_sku) { $content .= '<td' . ($k == count($products_sku) - 1 ? ' class="last"' : '') . '>' . $product_sku . '</td>'; } $content .= '</tr>'; $row_class = $row_class == 'even' ? 'odd' : 'even'; } //add product manufacturers if (!empty($products_manufacturers)) { $content .= '<tr class="' . $row_class . '">' . '<th>' . lang('field_products_manufacturer') . '</th>'; foreach ($products_manufacturers as $k => $product_manufacturer) { $content .= '<td' . ($k == count($products_manufacturers) - 1 ? ' class="last"' : '') . '>' . $product_manufacturer . '</td>'; } $content .= '</tr>'; $row_class = $row_class == 'even' ? 'odd' : 'even'; } //add product variants //add product description if (!empty($products_desciptions)) { $content .= '<tr class="' . $row_class . ' last">' . '<th valign="top">' . lang('field_products_description') . '</th>'; foreach ($products_desciptions as $k => $product_description) { $content .= '<td' . ($k == count($products_desciptions) - 1 ? ' class="last"' : '') . ' valign="top">' . $product_description . '</td>'; } $content .= '</tr>'; $row_class = $row_class == 'even' ? 'odd' : 'even'; } $content .= '</tbody>'; $content .= '</table>'; } return $content; }
$product = load_product_library($accessory['accessories_id']); ?> <li class="clearfix"> <div class="left"> <a href="<?php echo site_url('product/' . $product->get_id()); ?> "> <img alt="<?php echo $product->get_title(); ?> " title="<?php echo $product->get_title(); ?> " src="<?php echo product_image_url($product->get_image()); ?> " alt="default thumb" class="thumb" /> </a> <h3> <a href="<?php echo site_url('product/' . $product->get_id()); ?> "> <?php echo $product->get_title(); ?> </a> </h3> <p class="description"> <?php
foreach ($products as $product_id => $product) { ?> <tr> <td class="product"> <a class="image visible-desktop" href="<?php echo site_url('product/' . $product['id']); ?> "> <img alt="<?php echo $product['name']; ?> " title="<?php echo $product['name']; ?> " src="<?php echo product_image_url($product['image'], 'mini'); ?> " alt="default thumb" class="thumb" /> </a> <div class="info"> <a class="name" href="<?php echo site_url('product/' . get_product_id($product['id'])); ?> "><?php echo $product['name']; ?> </a> <span class="sku"><?php echo lang('field_sku') . ' ' . $product['sku']; ?> </span>