  |
25 | 25 | | } |
| |
26 | 26 | | |
| |
27 | 27 | | function initialize() { |
  |
28 | | - | $this->_content = 'dummy text'; |
| |
| 28 | + | global $osC_RecentlyVisited, $osC_Language, $osC_Image; |
| |
| 29 | + | |
| |
| 30 | + | if ($osC_RecentlyVisited->hasHistory()) { |
| |
| 31 | + | $this->_content = '<table border="0" width="100%" cellspacing="0" cellpadding="2">' . |
| |
| 32 | + | ' <tr>'; |
| |
| 33 | + | |
| |
| 34 | + | if ($osC_RecentlyVisited->hasProducts()) { |
| |
| 35 | + | $this->_content .= ' <td valign="top">' . |
| |
| 36 | + | ' <h6>' . $osC_Language->get('recently_visited_products_title') . '</h6>' . |
| |
| 37 | + | ' <ol style="list-style: none; margin: 0; padding: 0;">'; |
| |
| 38 | + | |
| |
| 39 | + | foreach ($osC_RecentlyVisited->getProducts() as $product) { |
| |
| 40 | + | $this->_content .= '<li style="padding-bottom: 15px;">'; |
| |
| 41 | + | |
| |
| 42 | + | if (SERVICE_RECENTLY_VISITED_SHOW_PRODUCT_IMAGES == '1') { |
| |
| 43 | + | $this->_content .= '<span style="float: left; width: ' . ($osC_Image->getWidth('mini') + 10) . 'px; text-align: center;">' . osc_link_object(tep_href_link(FILENAME_PRODUCTS, $product['keyword']), $osC_Image->show($product['image'], $product['name'], null, 'mini')) . '</span>'; |
| |
| 44 | + | } |
| |
| 45 | + | |
| |
| 46 | + | $this->_content .= '<div style="padding-left: ' . ($osC_Image->getWidth('mini') + 10) . 'px;">' . osc_link_object(tep_href_link(FILENAME_PRODUCTS, $product['keyword']), $product['name']) . '<br />'; |
| |
| 47 | + | |
| |
| 48 | + | if (SERVICE_RECENTLY_VISITED_SHOW_PRODUCT_PRICES == '1') { |
| |
| 49 | + | $this->_content .= $product['price'] . ' '; |
| |
| 50 | + | } |
| |
| 51 | + | |
| |
| 52 | + | $this->_content .= '<i>(' . sprintf($osC_Language->get('recently_visited_item_in_category'), osc_link_object(tep_href_link(FILENAME_DEFAULT, 'cPath=' . $product['category_path']), $product['category_name'])) . ')</i></div></li>'; |
| |
| 53 | + | } |
| |
| 54 | + | |
| |
| 55 | + | $this->_content .= ' </ol>' . |
| |
| 56 | + | ' </td>'; |
| |
| 57 | + | } |
| |
| 58 | + | |
| |
| 59 | + | if ($osC_RecentlyVisited->hasCategories()) { |
| |
| 60 | + | $this->_content .= ' <td valign="top">' . |
| |
| 61 | + | ' <h6>' . $osC_Language->get('recently_visited_categories_title') . '</h6>' . |
| |
| 62 | + | ' <ol style="list-style: none; margin: 0; padding: 0;">'; |
| |
| 63 | + | |
| |
| 64 | + | foreach ($osC_RecentlyVisited->getCategories() as $category) { |
| |
| 65 | + | $this->_content .= '<li>' . osc_link_object(tep_href_link(FILENAME_DEFAULT, 'cPath=' . $category['path']), $category['name']); |
| |
| 66 | + | |
| |
| 67 | + | if (!empty($category['parent_id'])) { |
| |
| 68 | + | $this->_content .= ' <i>(' . sprintf($osC_Language->get('recently_visited_item_in_category'), osc_link_object(tep_href_link(FILENAME_DEFAULT, 'cPath=' . $category['parent_id']), $category['parent_name'])) . ')</i>'; |
| |
| 69 | + | } |
| |
| 70 | + | |
| |
| 71 | + | $this->_content .= '</li>'; |
| |
| 72 | + | } |
| |
| 73 | + | |
| |
| 74 | + | $this->_content .= ' </ol>' . |
| |
| 75 | + | ' </td>'; |
| |
| 76 | + | } |
| |
| 77 | + | |
| |
| 78 | + | if ($osC_RecentlyVisited->hasSearches()) { |
| |
| 79 | + | $this->_content .= ' <td valign="top">' . |
| |
| 80 | + | ' <h6>' . $osC_Language->get('recently_visited_searches_title') . '</h6>' . |
| |
| 81 | + | ' <ol style="list-style: none; margin: 0; padding: 0;">'; |
| |
| 82 | + | |
| |
| 83 | + | foreach ($osC_RecentlyVisited->getSearches() as $searchphrase) { |
| |
| 84 | + | $this->_content .= '<li>' . osc_link_object(tep_href_link(FILENAME_SEARCH, 'keywords=' . $searchphrase['keywords']), tep_output_string_protected($searchphrase['keywords'])) . ' <i>(' . number_format($searchphrase['results']) . ' results)</i></li>'; |
| |
| 85 | + | } |
| |
| 86 | + | |
| |
| 87 | + | $this->_content .= ' </ol>' . |
| |
| 88 | + | ' </td>'; |
| |
| 89 | + | } |
| |
| 90 | + | |
| |
| 91 | + | $this->_content .= ' </tr>' . |
| |
| 92 | + | '</table>'; |
| |
| 93 | + | } |
  |
29 | 94 | | } |
| |
30 | 95 | | } |
| |
31 | 96 | | ?> |